Changeset 21183 for trunk/psModules/src/objects/pmSourceFitModel.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceFitModel.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceFitModel.c
r20937 r21183 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $9 * @date $Date: 200 8-12-08 02:51:14$8 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-27 06:39:38 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 56 56 pmModel *model, 57 57 pmSourceFitMode mode, 58 ps MaskType maskVal)58 psImageMaskType maskVal) 59 59 { 60 60 psTrace("psModules.objects", 5, "---- %s begin ----\n", __func__); … … 81 81 for (psS32 j = 0; j < source->pixels->numCols; j++) { 82 82 // skip masked points 83 if (source->maskObj->data. U8[i][j] & maskVal) {83 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) { 84 84 continue; 85 85 } … … 121 121 // create the minimization constraints 122 122 psMinConstraint *constraint = psMinConstraintAlloc(); 123 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_ U8);123 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 124 124 constraint->checkLimits = model->modelLimits; 125 125 … … 131 131 nParams = 1; 132 132 psVectorInit (constraint->paramMask, 1); 133 constraint->paramMask->data. U8[PM_PAR_I0] = 0;133 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0; 134 134 break; 135 135 case PM_SOURCE_FIT_PSF: … … 137 137 nParams = 3; 138 138 psVectorInit (constraint->paramMask, 1); 139 constraint->paramMask->data. U8[PM_PAR_I0] = 0;140 constraint->paramMask->data. U8[PM_PAR_XPOS] = 0;141 constraint->paramMask->data. U8[PM_PAR_YPOS] = 0;139 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0; 140 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_XPOS] = 0; 141 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_YPOS] = 0; 142 142 break; 143 143 case PM_SOURCE_FIT_EXT: … … 145 145 nParams = params->n - 1; 146 146 psVectorInit (constraint->paramMask, 0); 147 constraint->paramMask->data. U8[PM_PAR_SKY] = 1;147 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_SKY] = 1; 148 148 break; 149 149 default: … … 175 175 fprintf (stderr, "%f ", params->data.F32[i]); 176 176 } 177 if ((constraint->paramMask != NULL) && constraint->paramMask->data. U8[i])177 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 178 178 continue; 179 179 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); … … 192 192 if (constraint->paramMask != NULL) { 193 193 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32); 194 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_ U8);195 altmask->data. U8[0] = 1;194 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 195 altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1; 196 196 for (int i = 1; i < dparams->n; i++) { 197 altmask->data. U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;197 altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1; 198 198 } 199 199 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc); 200 200 201 201 for (int i = 0; i < dparams->n; i++) { 202 if (!constraint->paramMask->data. U8[i])202 if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 203 203 continue; 204 204 // note that delta is the value *subtracted* from the parameter
Note:
See TracChangeset
for help on using the changeset viewer.
