Changeset 28405 for trunk/psphot/src/psphotMagnitudes.c
- Timestamp:
- Jun 18, 2010, 2:25:38 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMagnitudes.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMagnitudes.c
r28098 r28405 18 18 // loop over the available readouts 19 19 for (int i = 0; i < num; i++) { 20 if (i == chisqNum) continue; // skip chisq image21 22 // find the currently selected readout23 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest24 psAssert (file, "missing file?");25 26 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);27 psAssert (readout, "missing readout?");28 29 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");30 psAssert (detections, "missing detections?");31 32 psArray *sources = detections->allSources;33 psAssert (sources, "missing sources?");34 35 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");36 psAssert (psf, "missing psf?");37 38 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf)) {20 if (i == chisqNum) continue; // skip chisq image 21 22 // find the currently selected readout 23 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest 24 psAssert (file, "missing file?"); 25 26 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 27 psAssert (readout, "missing readout?"); 28 29 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 30 psAssert (detections, "missing detections?"); 31 32 psArray *sources = detections->allSources; 33 psAssert (sources, "missing sources?"); 34 35 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 36 psAssert (psf, "missing psf?"); 37 38 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf)) { 39 39 psError (PSPHOT_ERR_CONFIG, false, "failed to measure magnitudes for %s entry %d", filerule, i); 40 return false;41 }40 return false; 41 } 42 42 } 43 43 return true; … … 50 50 51 51 if (!sources->n) { 52 psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping source magnitudes");53 return true;54 } 55 52 psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping source magnitudes"); 53 return true; 54 } 55 56 56 psTimerStart ("psphot.mags"); 57 57 … … 122 122 if (!psThreadJobAddPending(job)) { 123 123 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 124 psFree (job);125 124 return false; 126 125 } 127 psFree(job);128 126 129 127 # if (0) … … 184 182 } 185 183 186 // clear the mask bit and set the circular mask pixels187 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));188 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, source->apRadius, "OR", markVal);184 // clear the mask bit and set the circular mask pixels 185 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 186 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, source->apRadius, "OR", markVal); 189 187 190 188 status = pmSourceMagnitudes (source, psf, photMode, maskVal); // maskVal includes markVal 191 189 if (status && isfinite(source->apMag)) Nap ++; 192 190 193 // clear the mask bit 194 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));191 // clear the mask bit 192 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 195 193 196 194 // re-subtract the object, leave local sky … … 273 271 if (!psThreadJobAddPending(job)) { 274 272 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 275 psFree (job);276 273 return false; 277 274 } 278 psFree(job);279 280 275 } 281 276
Note:
See TracChangeset
for help on using the changeset viewer.
