Changeset 17396 for trunk/psphot/src/psphotIsophotal.c
- Timestamp:
- Apr 8, 2008, 8:36:06 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotIsophotal.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotIsophotal.c
r15562 r17396 1 # include "psphot.h" 1 # include "psphotInternal.h" 2 3 static float ISOPHOT_FLUX = NAN; 2 4 3 5 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psMaskType maskVal) { … … 14 16 15 17 // flux at which to measure isophotal parameters 16 // XXX cache this? 17 float ISOPHOT_FLUX = psMetadataLookupF32 (&status, recipe, "ISOPHOTAL_FLUX"); 18 if (!isfinite(ISOPHOT_FLUX)) { 19 // XXX ISOPHOTAL_FLUX should be specified in mags, need the zero point to get counts/sec 20 ISOPHOT_FLUX = psMetadataLookupF32 (&status, recipe, "ISOPHOTAL_FLUX"); 21 assert (status); 22 } 18 23 19 24 // find the first bin below the flux level and the last above the level 20 // XXX can this be done faster with disection?25 // XXX can this be done faster with bisection? 21 26 // XXX do I need to worry about crazy outliers? 22 27 // XXX should i be smoothing or fitting the curve? … … 27 32 if ((firstBelow < 0) && (flux->data.F32[i] < ISOPHOT_FLUX)) firstBelow = i; 28 33 } 29 34 // if we don't go out far enough, we have a problem... 35 if (lastAbove == flux->n - 1) { 36 psTrace ("psphot", 5, "did not go out far enough to reach isophotal magnitude"); 37 // XXX raise a flag ? 38 return false; 39 } 40 if (firstBelow < 0) { 41 psTrace ("psphot", 5, "did not go out far enough to bound isophotal magnitude: error unmeasured"); 42 // XXX raise a flag ? 43 lastAbove = firstBelow; 44 return false; 45 } 46 30 47 // need to examine pixels in this vicinity 31 48 float isophotalFluxFirst = 0; … … 56 73 source->extpars->isophot->radErr = isophotalRadErr; 57 74 75 psTrace ("psphot", 5, "Isophot flux:%f +/- %f @ %f +/- %f for %f, %f\n", 76 source->extpars->isophot->mag, source->extpars->isophot->magErr, 77 source->extpars->isophot->rad, source->extpars->isophot->radErr, 78 source->peak->xf, source->peak->yf); 79 58 80 return true; 59 81
Note:
See TracChangeset
for help on using the changeset viewer.
