IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2008, 1:52:32 PM (18 years ago)
Author:
eugene
Message:

significant work on the I/O pmFPAfiles, especially to get the format / metaCamera correct for the input psf vs the input image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080511/ppSim/src/ppSimDetections.c

    r17818 r17901  
    22
    33bool ppSimDetections (psImage *significance, psMetadata *recipe, psArray *sources) {
     4    psAssert (sources, "programming error: ppSimDetections passed NULL sources");
    45
    5   bool status;
     6    bool status;
    67
    7   // for each source, measure the significance of the peak at the given coordinate
    8   // 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?
    910
    10   // XXX need to get the effective Area from the PSF sigma
    11   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);
    1415
    15   int row0 = significance->row0;
    16   int col0 = significance->col0;
     16    int row0 = significance->row0;
     17    int col0 = significance->col0;
    1718
    18   for (int i = 0; i < sources->n; i++) {
     19    for (int i = 0; i < sources->n; i++) {
    1920
    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");
    2324
    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);
    2627
    27   }
    28   return true;
     28    }
     29    return true;
    2930}
Note: See TracChangeset for help on using the changeset viewer.