IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 28, 2008, 1:49:32 PM (18 years ago)
Author:
Paul Price
Message:

Implementing background subtraction in the place of replacing bad pixels with the background. Bad pixels are automatically identified and set to 0 in the process, so this is effectively the same thing as before, except it subtracts the background as well. The background (from psphot) is built if it doesn't exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageParseCamera.c

    r18896 r20444  
    7474            return NULL;
    7575        }
    76         // XXX have ppImageDefineFile return the pmFPAfile?
    77         pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK");
    78         psAssert (mask, "mask not defined?  not possible!");
    79 
    80         // Need to read the names of bit masks from the mask header and set them in the
    81         // recipe.  If we are loading this from the detrend db, this action will happen
    82         // when the file is resolved.
    83         if (!mask->detrend) {
    84             // XXX need to load the mask bit names from one of the headers
    85             // this grabs the first available hdu : no guarantee that it will be valid, though
    86             pmHDU *hdu = pmHDUGetFirst (mask->fpa);
    87             if (!hdu) {
    88                 psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK");
    89                 return NULL;
    90             }
    91             // XXX is this consistent with the pmConfigMaskReadHeader call above?
    92             if (!pmConfigMaskReadHeader (config, hdu->header)) {
    93                 psError(PS_ERR_IO, false, "error in mask bits");
    94                 return NULL;
    95             }
    96         }
     76        // XXX have ppImageDefineFile return the pmFPAfile?
     77        pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK");
     78        psAssert (mask, "mask not defined?  not possible!");
     79
     80        // Need to read the names of bit masks from the mask header and set them in the
     81        // recipe.  If we are loading this from the detrend db, this action will happen
     82        // when the file is resolved.
     83        if (!mask->detrend) {
     84            // XXX need to load the mask bit names from one of the headers
     85            // this grabs the first available hdu : no guarantee that it will be valid, though
     86            pmHDU *hdu = pmHDUGetFirst (mask->fpa);
     87            if (!hdu) {
     88                psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK");
     89                return NULL;
     90            }
     91            // XXX is this consistent with the pmConfigMaskReadHeader call above?
     92            if (!pmConfigMaskReadHeader (config, hdu->header)) {
     93                psError(PS_ERR_IO, false, "error in mask bits");
     94                return NULL;
     95            }
     96        }
    9797    }
    9898    if (options->doShutter) {
     
    114114    int nThreads = psMetadataLookupS32 (&status, config->arguments, "NTHREADS");
    115115    if (nThreads > 0) {
    116         int nScanRows = psMetadataLookupS32 (&status, recipe, "SCAN.ROWS");
    117         pmDetrendSetThreadTasks (nScanRows);
     116        int nScanRows = psMetadataLookupS32 (&status, recipe, "SCAN.ROWS");
     117        pmDetrendSetThreadTasks (nScanRows);
    118118    }
    119119
     
    274274    // For photometry, we operate on the chip-mosaicked image
    275275    // we create a copy of the mosaicked image for psphot so we can write out a clean image
    276     if (options->doPhotom) {
     276    if (options->doPhotom || options->doBG) {
    277277
    278278        // this file is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
Note: See TracChangeset for help on using the changeset viewer.