IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 19, 2007, 4:40:44 PM (19 years ago)
Author:
Paul Price
Message:

Extensive changes to APIs to allow use of a nominated value to mask
against (the maskVal). Previously, the mask values were either
hard-coded (e.g., PM_MASK_SAT) or taken as anything non-zero. The
code is tested with psModules (which has similar changes) and does not
crash, but neither is it successful in marking all bad pixels. For
this reason, I have left the "gutter" pixels (cell gaps) set to 0
instead of NAN in pmFPAMosaic.

File:
1 edited

Legend:

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

    r12792 r13900  
    22
    33bool psphotMagnitudes(psArray *sources,
    4                       psMetadata *recipe,
    5                       pmPSF *psf,
    6                       pmReadout *background)
     4                      psMetadata *recipe,
     5                      pmPSF *psf,
     6                      pmReadout *background,
     7                      psMaskType maskVal,
     8                      psMaskType mark)
    79{
    810    bool status = false;
     
    1315    pmSourceMagnitudesInit (recipe);
    1416
    15     // XXX require that we have a background model, or 
     17    // XXX require that we have a background model, or
    1618    // allow it to be missing, setting local sky to 0.0?
    1719    PS_ASSERT (background, false);
    1820
    19     // the binning details are saved on the analysis metadata 
     21    // the binning details are saved on the analysis metadata
    2022    psImageBinning *binning = psMetadataLookupPtr(&status, recipe, "PSPHOT.BACKGROUND.BINNING");
    2123    PS_ASSERT (status, false);
     
    2931
    3032    for (int i = 0; i < sources->n; i++) {
    31         pmSource *source = (pmSource *) sources->data[i];
    32         status = pmSourceMagnitudes (source, psf, photMode);
    33         if (status) Nap ++;
     33        pmSource *source = (pmSource *) sources->data[i];
     34        status = pmSourceMagnitudes (source, psf, photMode, maskVal, mark);
     35        if (status) Nap ++;
    3436
    35         source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, background->image, binning);
    36         if (isnan(source->sky) && false) {
    37           psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky");
    38           psErrorStackPrint(NULL, " ");
    39           psErrorClear();
    40         }
    41     }   
     37        source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, background->image, binning);
     38        if (isnan(source->sky) && false) {
     39          psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky");
     40          psErrorStackPrint(NULL, " ");
     41          psErrorClear();
     42        }
     43    }
    4244
    4345    psLogMsg ("psphot.magnitudes", PS_LOG_DETAIL, "measure magnitudes : %f sec for %ld objects (%d with apertures)\n", psTimerMark ("psphot"), sources->n, Nap);
Note: See TracChangeset for help on using the changeset viewer.