- Timestamp:
- Dec 31, 2008, 10:31:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/psModules/src/objects/pmSourceFitSet.c
r20937 r21075 6 6 * @author GLG, MHPCC 7 7 * 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 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 281 281 for (int j = 0; j < paramOne->n; j++) { 282 282 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; 284 284 } 285 285 break; … … 290 290 if (j == PM_PAR_YPOS) continue; 291 291 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; 293 293 } 294 294 break; 295 295 case PM_SOURCE_FIT_EXT: 296 296 // 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; 298 298 break; 299 299 default: … … 332 332 psArray *modelSet, 333 333 pmSourceFitMode mode, 334 ps MaskType maskVal)334 psImageMaskType maskVal) 335 335 { 336 336 psTrace("psModules.objects", 3, "---- %s begin ----\n", __func__); … … 356 356 for (psS32 j = 0; j < source->pixels->numCols; j++) { 357 357 // 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) { 359 359 continue; 360 360 } … … 402 402 // create the minimization constraints 403 403 psMinConstraint *constraint = psMinConstraintAlloc(); 404 constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_ U8);404 constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_VECTOR_MASK); 405 405 constraint->checkLimits = pmSourceFitSetCheckLimits; 406 406 … … 415 415 if (psTraceGetLevel("psModules.objects") >= 5) { 416 416 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]); 418 418 } 419 419 } … … 448 448 psVector *dparams = psVectorAlloc (thisSet->nParamSet, PS_TYPE_F32); 449 449 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]) 451 451 continue; 452 452 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); … … 456 456 if (constraint->paramMask != NULL) { 457 457 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; 460 460 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; 462 462 } 463 463 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, pmSourceFitSetFunction); 464 464 465 465 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]) 467 467 continue; 468 468 // note that delta is the value *subtracted* from the parameter
Note:
See TracChangeset
for help on using the changeset viewer.
