- Timestamp:
- Jul 31, 2012, 11:50:18 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120627/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120627/psphot
- Property svn:mergeinfo changed
/trunk/psphot merged: 34135-34136,34200-34202,34215,34218,34226
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120627/psphot/src
- Property svn:mergeinfo changed
/trunk/psphot/src merged: 34135-34136,34200-34202,34215,34218,34226
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120627/psphot/src/psphotFitSourcesLinear.c
r34086 r34247 13 13 14 14 // for now, let's store the detections on the readout->analysis for each readout 15 bool psphotFitSourcesLinear (pmConfig *config, const pmFPAview *view, const char *filerule, bool final )15 bool psphotFitSourcesLinear (pmConfig *config, const pmFPAview *view, const char *filerule, bool final, bool skipNegativeFluxSources) 16 16 { 17 17 bool status = true; … … 51 51 psAssert (readout, "missing readout?"); 52 52 53 if (psMetadataLookupBool (&status, readout->analysis, "PSPHOT.SKIP.INPUT")) { 54 psLogMsg ("psphot", PS_LOG_DETAIL, "skipping fit sources for input file %d", i); 55 continue; 56 } 57 58 53 59 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 54 60 psAssert (detections, "missing detections?"); … … 60 66 psAssert (psf, "missing psf?"); 61 67 62 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarModePass1 )) {68 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarModePass1, skipNegativeFluxSources)) { 63 69 psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for %s entry %d", filerule, i); 64 70 return false; … … 79 85 80 86 // rerun fit with correct fitVarMode 81 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarMode)) { 87 // XXX: does skipNegativeFlux work here? 88 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final, fitVarMode, skipNegativeFluxSources)) { 82 89 psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for %s entry %d", filerule, i); 83 90 return false; … … 130 137 } 131 138 132 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final, pmSourceFitVarMode fitVarMode ) {139 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final, pmSourceFitVarMode fitVarMode, bool skipNegativeFluxSources) { 133 140 bool status; 134 141 float x; … … 177 184 float MIN_VALID_FLUX = psMetadataLookupF32(&status, recipe, "PSF_FIT_MIN_VALID_FLUX"); 178 185 if (!status) { 186 MIN_VALID_FLUX = 0.0; 187 } 188 if (skipNegativeFluxSources && MIN_VALID_FLUX < 0) { 179 189 MIN_VALID_FLUX = 0.0; 180 190 } … … 252 262 if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit) 253 263 if (modelSum < 0.8) { 254 fprintf (stderr, "low-sig model @ %f, %f (%f masked sum, %f sum, %f peak)\n",264 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "low-sig model @ %f, %f (%f masked sum, %f sum, %f peak)\n", 255 265 source->peak->xf, source->peak->yf, maskedSum, modelSum, source->peak->rawFlux); 256 266 } 257 267 if (maskedSum < 0.5) { 258 fprintf (stderr, "worrying model @ %f, %f (%f masked sum, %f sum, %f peak)\n",268 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "worrying model @ %f, %f (%f masked sum, %f sum, %f peak)\n", 259 269 source->peak->xf, source->peak->yf, maskedSum, modelSum, source->peak->rawFlux); 260 270 }
Note:
See TracChangeset
for help on using the changeset viewer.
