- Timestamp:
- Jun 4, 2008, 1:52:32 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080511/ppSim/src/ppSimDetections.c
r17818 r17901 2 2 3 3 bool ppSimDetections (psImage *significance, psMetadata *recipe, psArray *sources) { 4 psAssert (sources, "programming error: ppSimDetections passed NULL sources"); 4 5 5 bool status;6 bool status; 6 7 7 // for each source, measure the significance of the peak at the given coordinate8 // where does this get stored?8 // for each source, measure the significance of the peak at the given coordinate 9 // where does this get stored? 9 10 10 // XXX need to get the effective Area from the PSF sigma11 float SIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "SIGMA_SMOOTH");12 psAssert (status, "SIGMA_SMOOTH missing: call psphotSignificanceImage first");13 float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH);11 // XXX need to get the effective Area from the PSF sigma 12 float SIGMA_SMTH = psMetadataLookupF32 (&status, recipe, "SIGMA_SMOOTH"); 13 psAssert (status, "SIGMA_SMOOTH missing: call psphotSignificanceImage first"); 14 float effArea = 4.0*M_PI*PS_SQR(SIGMA_SMTH); 14 15 15 int row0 = significance->row0;16 int col0 = significance->col0;16 int row0 = significance->row0; 17 int col0 = significance->col0; 17 18 18 for (int i = 0; i < sources->n; i++) {19 for (int i = 0; i < sources->n; i++) { 19 20 20 pmSource *source = sources->data[i];21 pmPeak *peak = source->peak;22 psAssert (peak, "peak is not defined for the source");21 pmSource *source = sources->data[i]; 22 pmPeak *peak = source->peak; 23 psAssert (peak, "peak is not defined for the source"); 23 24 24 peak->value = significance->data.F32[peak->y-row0][peak->x-col0];25 peak->SN = sqrt(peak->value*effArea);25 peak->value = significance->data.F32[peak->y-row0][peak->x-col0]; 26 peak->SN = sqrt(peak->value*effArea); 26 27 27 }28 return true;28 } 29 return true; 29 30 }
Note:
See TracChangeset
for help on using the changeset viewer.
