Changeset 18555 for trunk/psphot/src/psphotFitSourcesLinear.c
- Timestamp:
- Jul 15, 2008, 10:25:50 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFitSourcesLinear.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFitSourcesLinear.c
r17516 r18555 10 10 // the analysis is performed wrt the simulated pixel values 11 11 12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER );12 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psMaskType markVal); 13 13 14 14 bool psphotFitSourcesLinear (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, bool final) { … … 22 22 psTimerStart ("psphot"); 23 23 24 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)25 psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels24 // bit-masks to test for good/bad pixels 25 psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); 26 26 assert (maskVal); 27 28 // bit-mask to mark pixels not used in analysis 29 psMaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT"); 30 assert (markVal); 31 32 // maskVal is used to test for rejected pixels, and must include markVal 33 maskVal |= markVal; 27 34 28 35 // source analysis is done in spatial order … … 157 164 158 165 // set the sky, sky_x, sky_y components of border matrix 159 SetBorderMatrixElements (border, readout, fitSources, CONSTANT_PHOTOMETRIC_WEIGHTS, SKY_FIT_ORDER );166 SetBorderMatrixElements (border, readout, fitSources, CONSTANT_PHOTOMETRIC_WEIGHTS, SKY_FIT_ORDER, markVal); 160 167 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "set border: %f (%d elements)\n", psTimerMark ("psphot"), sparse->Nelem); 161 168 … … 221 228 // on the pixels which correspond to all of the sources of interest. These elements fill in 222 229 // the border matrix components in the sparse matrix equation. 223 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER ) {230 static bool SetBorderMatrixElements (psSparseBorder *border, pmReadout *readout, psArray *sources, bool constant_weights, int SKY_FIT_ORDER, psMaskType markVal) { 224 231 225 232 // generate the image-wide weight terms … … 227 234 psRegion fullArray = psRegionSet (0, 0, 0, 0); 228 235 fullArray = psRegionForImage (readout->mask, fullArray); 229 psImageMaskRegion (readout->mask, fullArray, "OR", PM_MASK_MARK);236 psImageMaskRegion (readout->mask, fullArray, "OR", markVal); 230 237 psLogMsg ("psphot.ensemble", PS_LOG_INFO, "step 1: %f sec\n", psTimerMark ("psphot")); 231 238 … … 237 244 float x = model->params->data.F32[PM_PAR_XPOS]; 238 245 float y = model->params->data.F32[PM_PAR_YPOS]; 239 psImageMaskCircle (source->maskView, x, y, model->radiusFit, "AND", PS_NOT_U8( PM_MASK_MARK));246 psImageMaskCircle (source->maskView, x, y, model->radiusFit, "AND", PS_NOT_U8(markVal)); 240 247 } 241 248 psLogMsg ("psphot.ensemble", PS_LOG_INFO, "step 2: %f sec\n", psTimerMark ("psphot")); … … 279 286 280 287 // turn off MARK for all image pixels 281 psImageMaskRegion (readout->mask, fullArray, "AND", PS_NOT_U8( PM_MASK_MARK));288 psImageMaskRegion (readout->mask, fullArray, "AND", PS_NOT_U8(markVal)); 282 289 psLogMsg ("psphot.ensemble", PS_LOG_INFO, "step 4: %f sec\n", psTimerMark ("psphot")); 283 290
Note:
See TracChangeset
for help on using the changeset viewer.
