IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 4, 2008, 3:10:25 PM (18 years ago)
Author:
eugene
Message:

merge changes from eam_branch_20080229: better flag definitions, cleanup footprint code (move into psphotFindDetections), push mask selection into called functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceSize.c

    r15802 r16820  
    66// compares the observed flux to the model.
    77
    8 bool psphotSourceSize (pmReadout *readout, psArray *sources, psMetadata *recipe) {
     8bool psphotSourceSize (pmReadout *readout, psArray *sources, psMetadata *recipe, long first) {
     9
     10    bool status;
     11
     12    psTimerStart ("psphot");
     13
     14    float CR_NSIGMA_LIMIT = psMetadataLookupF32 (&status, recipe, "PSPHOT.CRNSIGMA.LIMIT");
     15    assert (status);
    916
    1017    // loop over all source
    11     for (int i = 0; i < sources->n; i++) {
     18    for (int i = first; i < sources->n; i++) {
    1219        pmSource *source = sources->data[i];
    1320
     21        // skip source if it was already measured
     22        if (isfinite(source->crNsigma)) continue;
     23
     24        source->crNsigma  = -1.0;
     25        source->extNsigma = -1.0;
     26
    1427        // source must have been subtracted
     28        source->crNsigma  = -3.0;
    1529        if (!(source->mode & PM_SOURCE_MODE_SUBTRACTED)) continue;
    1630
     
    2337
    2438        // skip sources which are too close to a boundary
     39        source->crNsigma  = -4.0;
    2540        if (xPeak < 1) continue;
    2641        if (xPeak > source->pixels->numCols - 2) continue;
     
    2944
    3045        // XXX for now, just skip any sources with masked pixels
     46        source->crNsigma  = -5.0;
    3147        bool keep = true;
    3248        for (int iy = -1; (iy <= +1) && keep; iy++) {
     
    97113        source->extNsigma = (nEXT > 0) ? fabs(fEXT) / nEXT : 0.0;
    98114        // NOTE: abs needed to make the Nsigma value positive
     115
     116        if (!isfinite(source->crNsigma)) {
     117          fprintf (stderr, ".");
     118          source->crNsigma = -6.0;
     119        }
     120
     121        if (source->crNsigma > CR_NSIGMA_LIMIT) {
     122          source->mode |= PM_SOURCE_MODE_CRLIMIT;
     123        }
    99124    }
     125
     126    psLogMsg ("psphot.size", PS_LOG_INFO, "measure source sizes for %ld sources: %f sec\n", sources->n - first, psTimerMark ("psphot"));
     127
    100128    return true;
    101129}
Note: See TracChangeset for help on using the changeset viewer.