Changeset 17561
- Timestamp:
- May 7, 2008, 11:14:09 AM (18 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 2 edited
-
psphotIsophotal.c (modified) (5 diffs)
-
psphotPetrosian.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotIsophotal.c
r17396 r17561 1 1 # include "psphotInternal.h" 2 3 static float ISOPHOT_FLUX = NAN;4 2 5 3 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psMaskType maskVal) { … … 16 14 17 15 // flux at which to measure isophotal parameters 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 } 16 // XXX ISOPHOTAL_FLUX should be specified in mags, need the zero point to get counts/sec 17 float ISOPHOT_FLUX = psMetadataLookupF32 (&status, recipe, "ISOPHOTAL_FLUX"); 18 assert (status); 23 19 24 20 // find the first bin below the flux level and the last above the level 25 21 // XXX can this be done faster with bisection? 26 // XXX do I need to worry about crazy outliers? 22 // XXX do I need to worry about crazy outliers? 27 23 // XXX should i be smoothing or fitting the curve? 28 24 int firstBelow = -1; … … 44 40 return false; 45 41 } 46 42 47 43 // need to examine pixels in this vicinity 48 44 float isophotalFluxFirst = 0; … … 65 61 source->extpars->isophot = pmSourceIsophotalValuesAlloc (); 66 62 } 67 63 68 64 // these are uncalibrated: instrumental mags and pixel units 69 65 source->extpars->isophot->mag = -2.5*log10(isophotalFlux); … … 74 70 75 71 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);72 source->extpars->isophot->mag, source->extpars->isophot->magErr, 73 source->extpars->isophot->rad, source->extpars->isophot->radErr, 74 source->peak->xf, source->peak->yf); 79 75 80 76 return true; -
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.
