Changeset 15040
- Timestamp:
- Sep 26, 2007, 5:35:47 PM (19 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 5 edited
-
Makefile.am (modified) (1 diff)
-
psphot.h (modified) (2 diffs)
-
psphotReadout.c (modified) (2 diffs)
-
psphotSortBySN.c (modified) (1 diff)
-
psphotSourceSize.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/Makefile.am
r15023 r15040 42 42 psphotSourceFits.c \ 43 43 psphotRadiusChecks.c \ 44 psphotSortBySN.c \45 44 psphotOutput.c \ 46 45 psphotGrowthCurve.c \ -
trunk/psphot/src/psphot.h
r15023 r15040 54 54 // basic support functions 55 55 void psphotModelClassInit (void); 56 int pmPeakSortBySN (const void **a, const void **b);57 int pmPeakSortByY (const void **a, const void **b);58 int pmSourceSortBySN (const void **a, const void **b);59 int pmSourceSortByY (const void **a, const void **b);60 56 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore, psMaskType maskVal); 61 57 bool psphotMaskReadout (pmReadout *readout, psMetadata *recipe, psMaskType maskVal); … … 116 112 bool psphotMakeResiduals (psArray *sources, psMetadata *recipe, pmPSF *psf, psMaskType maskVal); 117 113 118 bool psphotExtendedSources (pmReadout *readout, psArray *sources, psMetadata *recipe, psMaskType maskVal);119 bool psphotPSFConvModel (pmSource *source, psMetadata *recipe, psMaskType maskVal);120 psKernel *psphotKernelFromPSF (pmSource *source, int nPix);114 bool psphotExtendedSources (pmReadout *readout, psArray *sources, psMetadata *recipe, psMaskType maskVal); 115 bool psphotPSFConvModel (pmSource *source, psMetadata *recipe, psMaskType maskVal); 116 psKernel *psphotKernelFromPSF (pmSource *source, int nPix); 121 117 122 bool psphotPetrosian (pmSource *source, psMetadata *recipe, psMaskType maskVal);123 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psMaskType maskVal);124 bool psphotAnnuli (pmSource *source, psMetadata *recipe, psMaskType maskVal);125 bool psphotKron (pmSource *source, psMetadata *recipe, psMaskType maskVal);118 bool psphotPetrosian (pmSource *source, psMetadata *recipe, psMaskType maskVal); 119 bool psphotIsophotal (pmSource *source, psMetadata *recipe, psMaskType maskVal); 120 bool psphotAnnuli (pmSource *source, psMetadata *recipe, psMaskType maskVal); 121 bool psphotKron (pmSource *source, psMetadata *recipe, psMaskType maskVal); 126 122 127 123 // structures & functions to support psf-convolved model fitting -
trunk/psphot/src/psphotReadout.c
r14943 r15040 171 171 172 172 // XXX test the CR/EXT measurement 173 // psphotSourceSize (readout, sources, recipe); 173 // XXX we need to call this here and after the second pass: option for starting number? 174 psphotSourceSize (readout, sources, recipe); 174 175 175 176 if (!strcasecmp (breakPt, "ENSEMBLE")) { … … 259 260 // plot positive sources 260 261 if (!havePSF) { 261 psphotSourcePlots (readout, sources, recipe, maskVal);262 // psphotSourcePlots (readout, sources, recipe, maskVal); 262 263 } 263 264 -
trunk/psphot/src/psphotSortBySN.c
r13006 r15040 1 # include "psphotInternal.h"2 1 3 4 // sort by SN (descending)5 int pmPeakSortBySN (const void **a, const void **b)6 {7 pmPeak *A = *(pmPeak **)a;8 pmPeak *B = *(pmPeak **)b;9 10 psF32 fA = A->SN;11 psF32 fB = B->SN;12 if (isnan (fA)) fA = 0;13 if (isnan (fB)) fB = 0;14 15 psF32 diff = fA - fB;16 if (diff > FLT_EPSILON) return (-1);17 if (diff < FLT_EPSILON) return (+1);18 return (0);19 }20 21 // sort by Y (ascending)22 int pmPeakSortByY (const void **a, const void **b)23 {24 pmPeak *A = *(pmPeak **)a;25 pmPeak *B = *(pmPeak **)b;26 27 psF32 fA = A->y;28 psF32 fB = B->y;29 30 psF32 diff = fA - fB;31 if (diff > FLT_EPSILON) return (+1);32 if (diff < FLT_EPSILON) return (-1);33 return (0);34 }35 36 // sort by SN (descending)37 int pmSourceSortBySN (const void **a, const void **b)38 {39 pmSource *A = *(pmSource **)a;40 pmSource *B = *(pmSource **)b;41 42 psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN;43 psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN;44 if (isnan (fA)) fA = 0;45 if (isnan (fB)) fB = 0;46 47 psF32 diff = fA - fB;48 if (diff > FLT_EPSILON) return (-1);49 if (diff < FLT_EPSILON) return (+1);50 return (0);51 }52 53 // sort by Y (ascending)54 int pmSourceSortByY (const void **a, const void **b)55 {56 pmSource *A = *(pmSource **)a;57 pmSource *B = *(pmSource **)b;58 59 psF32 fA = (A->peak == NULL) ? 0 : A->peak->y;60 psF32 fB = (B->peak == NULL) ? 0 : B->peak->y;61 62 psF32 diff = fA - fB;63 if (diff > FLT_EPSILON) return (+1);64 if (diff < FLT_EPSILON) return (-1);65 return (0);66 }67 -
trunk/psphot/src/psphotSourceSize.c
r13086 r15040 7 7 8 8 bool psphotSourceSize (pmReadout *readout, psArray *sources, psMetadata *recipe) { 9 10 FILE *f = fopen ("srcsize.dat", "w");11 9 12 10 // loop over all source … … 53 51 // P(chisq > chisq_obs; Ndof) = gamma_Q (Ndof/2, chisq/2) 54 52 // Ndof = 4 ? (four measurements, no free parameters) 55 float Ppsf = gsl_sf_gamma_inc_Q (2, 0.5*chisq); 53 // XXX this value is going to be biased low because of systematic errors. 54 // we need to calibrate it somehow 55 source->psfProb = gsl_sf_gamma_inc_Q (2, 0.5*chisq); 56 56 57 57 float fCR = 0.0; … … 87 87 nEXT ++; 88 88 } 89 fCR = (nCR > 0) ? fCR / nCR : 0.0; 90 fEXT = (nEXT > 0) ? fEXT / nEXT : 0.0; 91 92 // XXX plot this as a function of flux / magnitude? 93 // XXX overlay outliers on an image? 94 95 fprintf (f, "%f %f %f %f %f %f %f\n", source->peak->xf, source->peak->yf, source->peak->flux, 96 chisq, Ppsf, fCR, fEXT); 89 source->crNsigma = (nCR > 0) ? fCR / nCR : 0.0; 90 source->extNsigma = (nEXT > 0) ? fEXT / nEXT : 0.0; 97 91 } 98 fclose (f);99 92 return true; 100 93 }
Note:
See TracChangeset
for help on using the changeset viewer.
