IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2008, 4:10:36 PM (18 years ago)
Author:
Paul Price
Message:

Include measurement of source fluxes as well for the minimum flux for
fake sources: if the fluxes for the input and target PSFs are
mismatched, then it's important to have this check.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackMatch.c

    r20098 r20426  
    1414#define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \
    1515                     PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
     16#define FAINT_SOURCE_FRAC 1.0e-4         // Set minimum flux to this fraction of faintest source flux
    1617
    1718//#define TESTING                         // Enable debugging output
     
    178179            }
    179180
     181            // Generate a fake image to match to
    180182            float minFlux = INFINITY;       // Minimum flux for fake image
    181183            {
     
    190192            }
    191193
    192             // Generate a fake image to match to
    193             if (!isfinite(minFlux)) {
    194                 float maxMag = -INFINITY;   // Maximum magnitude of sources
    195                 for (int i = 0; i < sources->n; i++) {
    196                     pmSource *source = sources->data[i]; // Source of interest
    197                     if (source->psfMag > maxMag && source->psfMag <= MAG_IGNORE &&
    198                         !(source->mode & SOURCE_MASK)) {
    199                         maxMag = source->psfMag;
    200                     }
     194            float maxMag = -INFINITY;   // Maximum magnitude of sources
     195            for (int i = 0; i < sources->n; i++) {
     196                pmSource *source = sources->data[i]; // Source of interest
     197                if (source->psfMag > maxMag && source->psfMag <= MAG_IGNORE &&
     198                    !(source->mode & SOURCE_MASK)) {
     199                    maxMag = source->psfMag;
    201200                }
    202                 minFlux = 0.01 * powf(10.0, -0.4 * maxMag);
    203             }
     201            }
     202            minFlux = PS_MIN(FAINT_SOURCE_FRAC * powf(10.0, -0.4 * maxMag), minFlux);
    204203
    205204            pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF
     
    266265            readout->mask   = psMemIncrRefCounter(output->mask);
    267266            readout->weight = psMemIncrRefCounter(output->weight);
    268 
    269             readout->analysis = psMetadataCopy(readout->analysis, output->analysis);
    270267        } else {
    271268            // Fake the convolution
     
    304301#endif
    305302
     303    readout->analysis = psMetadataCopy(readout->analysis, output->analysis);
     304
    306305// Extract the regions and solutions used in the image matching
    307306// This stops them from being freed when we iterate back up the FPA
     
    359358        float vf = psMetadataLookupF32(NULL, readout->parent->concepts, "CELL.VARFACTOR"); // Variance factor
    360359        *chi2 /= vf * num;
     360        psLogMsg("ppStack", PS_LOG_INFO, "Additional variance from chi^2: %f", *chi2);
    361361    }
    362362
Note: See TracChangeset for help on using the changeset viewer.