IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 31, 2008, 10:31:29 AM (17 years ago)
Author:
eugene
Message:

conversion of psMaskType to psImageMaskType or psVectorMaskType as needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/psModules/src/objects/pmSourceFitSet.c

    r20937 r21075  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-12-08 02:51:14 $
     8 *  @version $Revision: 1.12.4.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-12-31 20:31:29 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    281281            for (int j = 0; j < paramOne->n; j++) {
    282282                if (j == PM_PAR_I0) continue;
    283                 constraint->paramMask->data.U8[n + j] = 1;
     283                constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + j] = 1;
    284284            }
    285285            break;
     
    290290                if (j == PM_PAR_YPOS) continue;
    291291                if (j == PM_PAR_I0) continue;
    292                 constraint->paramMask->data.U8[n + j] = 1;
     292                constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + j] = 1;
    293293            }
    294294            break;
    295295          case PM_SOURCE_FIT_EXT:
    296296            // EXT model fits all params (except sky)
    297             constraint->paramMask->data.U8[n + PM_PAR_SKY] = 1;
     297            constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + PM_PAR_SKY] = 1;
    298298            break;
    299299          default:
     
    332332                     psArray *modelSet,
    333333                     pmSourceFitMode mode,
    334                      psMaskType maskVal)
     334                     psImageMaskType maskVal)
    335335{
    336336    psTrace("psModules.objects", 3, "---- %s begin ----\n", __func__);
     
    356356        for (psS32 j = 0; j < source->pixels->numCols; j++) {
    357357            // skip masked points
    358             if (source->maskObj->data.U8[i][j] & maskVal) {
     358            if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) {
    359359                continue;
    360360            }
     
    402402    // create the minimization constraints
    403403    psMinConstraint *constraint = psMinConstraintAlloc();
    404     constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_U8);
     404    constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_VECTOR_MASK);
    405405    constraint->checkLimits = pmSourceFitSetCheckLimits;
    406406
     
    415415    if (psTraceGetLevel("psModules.objects") >= 5) {
    416416        for (int i = 0; i < params->n; i++) {
    417             fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data.U8[i]);
     417            fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]);
    418418        }
    419419    }
     
    448448    psVector *dparams = psVectorAlloc (thisSet->nParamSet, PS_TYPE_F32);
    449449    for (int i = 0; i < dparams->n; i++) {
    450         if ((constraint->paramMask != NULL) && constraint->paramMask->data.U8[i])
     450        if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    451451            continue;
    452452        dparams->data.F32[i] = sqrt(covar->data.F32[i][i]);
     
    456456    if (constraint->paramMask != NULL) {
    457457        psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32);
    458         psVector *altmask = psVectorAlloc (params->n, PS_TYPE_U8);
    459         altmask->data.U8[0] = 1;
     458        psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
     459        altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1;
    460460        for (int i = 1; i < dparams->n; i++) {
    461             altmask->data.U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;
     461            altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1;
    462462        }
    463463        psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, pmSourceFitSetFunction);
    464464
    465465        for (int i = 0; i < dparams->n; i++) {
    466             if (!constraint->paramMask->data.U8[i])
     466            if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
    467467                continue;
    468468            // note that delta is the value *subtracted* from the parameter
Note: See TracChangeset for help on using the changeset viewer.