IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17217


Ignore:
Timestamp:
Mar 28, 2008, 4:08:16 PM (18 years ago)
Author:
Paul Price
Message:

Adding option to mask bad shutter-correction pixels

Location:
branches/pap_branch_080320/psModules/src/detrend
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c

    r17155 r17217  
    631631
    632632
    633 bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter)
     633bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter, psMaskType blank)
    634634{
    635635    PS_ASSERT_PTR_NON_NULL(readout, false);
     
    675675    }
    676676    psImage *image = readout->image;    // Image to correct
     677    psImage *mask = readout->mask;      // Corresponding mask
    677678
    678679    if (exptime <= 0.0) {
     
    681682        for (int y = 0; y < image->numRows; y++) {
    682683            for (int x = 0; x < image->numCols; x++) {
     684                if (mask && !isfinite(shutterImage->data.F32[y][x])) {
     685                    mask->data.PS_TYPE_MASK_DATA[y][x] |= blank;
     686                    image->data.F32[y][x] = NAN;
     687                    continue;
     688                }
    683689                image->data.F32[y][x] *= 1.0 / (exptime + shutterImage->data.F32[y][x]);
    684690            }
     
    692698        for (int y = 0; y < image->numRows; y++) {
    693699            for (int x = 0; x < image->numCols; x++) {
     700                if (mask && !isfinite(shutterImage->data.F32[y][x])) {
     701                    mask->data.PS_TYPE_MASK_DATA[y][x] |= blank;
     702                    image->data.F32[y][x] = NAN;
     703                    continue;
     704                }
    694705                image->data.F32[y][x] *= exptime / (exptime + shutterImage->data.F32[y][x]);
    695706            }
  • branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.h

    r17155 r17217  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.14.22.1 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2008-03-27 23:28:38 $
     7 * @version $Revision: 1.14.22.2 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-03-29 02:08:16 $
    99 * Copyright 2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    129129/// Given a shutter correction (with dT for each pixel), applies this correction to an input image.
    130130bool pmShutterCorrectionApply(
    131     pmReadout *readout, ///< Readout to which to apply shutter correction
    132     const pmReadout *shutter ///< Shutter correction readout, with dT for each pixel
     131    pmReadout *readout,                 ///< Readout to which to apply shutter correction
     132    const pmReadout *shutter,           ///< Shutter correction readout, with dT for each pixel
     133    psMaskType blank                    ///< Value to give blank pixels
    133134    );
    134135
Note: See TracChangeset for help on using the changeset viewer.