Changeset 17561 for trunk/psphot/src/psphotPetrosian.c
- Timestamp:
- May 7, 2008, 11:14:09 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotPetrosian.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotPetrosian.c
r17396 r17561 1 1 # include "psphotInternal.h" 2 3 static float PETROSIAN_R0 = NAN;4 static float PETROSIAN_RF = NAN;5 2 6 3 bool psphotPetrosian (pmSource *source, psMetadata *recipe, psMaskType maskVal) { … … 17 14 18 15 // flux at which to measure isophotal parameters 19 if (!isfinite(PETROSIAN_R0)) { 20 PETROSIAN_R0 = psMetadataLookupF32 (&status, recipe, "PETROSIAN_R0"); 21 PETROSIAN_RF = psMetadataLookupF32 (&status, recipe, "PETROSIAN_FLUX_RATIO"); 22 assert (status); 23 } 16 float PETROSIAN_R0 = psMetadataLookupF32 (&status, recipe, "PETROSIAN_R0"); 17 float PETROSIAN_RF = psMetadataLookupF32 (&status, recipe, "PETROSIAN_FLUX_RATIO"); 18 assert (status); 24 19 25 20 // first find flux at R0 … … 50 45 } 51 46 fluxR0 /= (float)(fluxRn); 52 47 53 48 // target flux for petrosian radius 54 49 float fluxRP = fluxR0 * PETROSIAN_RF; … … 56 51 // find the first bin below the flux level and the last above the level 57 52 // XXX can this be done faster with bisection? 58 // XXX do I need to worry about crazy outliers? 53 // XXX do I need to worry about crazy outliers? 59 54 // XXX should i be smoothing or fitting the curve? 60 55 int firstBelow = -1; … … 97 92 source->extpars->petrosian = pmSourcePetrosianValuesAlloc (); 98 93 } 99 94 100 95 // these are uncalibrated: instrumental mags and pixel units 101 96 source->extpars->petrosian->mag = -2.5*log10(fluxRPSum); … … 106 101 107 102 psTrace ("psphot", 5, "Petrosian flux:%f +/- %f @ %f +/- %f for %f, %f\n", 108 source->extpars->petrosian->mag, source->extpars->petrosian->magErr,109 source->extpars->petrosian->rad, source->extpars->petrosian->radErr,110 source->peak->xf, source->peak->yf);103 source->extpars->petrosian->mag, source->extpars->petrosian->magErr, 104 source->extpars->petrosian->rad, source->extpars->petrosian->radErr, 105 source->peak->xf, source->peak->yf); 111 106 112 107 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
