IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 18, 2007, 5:40:48 PM (19 years ago)
Author:
Paul Price
Message:

Splitting out shutter correction so that it can run as we read in bits and pieces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmShutterCorrection.h

    r12988 r13870  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-04-24 21:17:19 $
     7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-06-19 03:40:48 $
    99 * Copyright 2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    128128                             );
    129129
     130//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     131
     132// Functions for doing the shutter correction piece-meal (don't have to read entire image stack into memory at
     133// once).  A single read run through the stack is required, calling pmShutterCorrectionAddReadout on each.
     134// Then pmShutterCorrectionReference provides the required reference shutter time, so that
     135// pmShutterCorrectionGenerate can generate a shutter correction piece by piece as overlapping pixels from
     136// each input are read in.
     137
     138
     139/// Data for measuring the shutter correction
     140typedef struct {
     141    int num;                            ///< Number of images
     142    int numCols, numRows;               ///< Size of images
     143    psArray *regions;                   ///< Regions at which to measure statistics
     144    psArray *mean;                      ///< Vector of means at each region
     145    psArray *stdev;                     ///< Vector of standard deviations at each region
     146    psVector *exptimes;                 ///< Exposure times for each image
     147    psVector *refs;                     ///< Reference fluxes
     148} pmShutterCorrectionData;
     149
     150/// Allocator for pmShutterCorrectionData
     151pmShutterCorrectionData *pmShutterCorrectionDataAlloc(int numCols, int numRows, ///< Size of images
     152                                                      int size ///< Size of regions
     153    );
     154
     155/// Add a readout to the correction data
     156///
     157/// Performs statistics on the readout, recording the data
     158bool pmShutterCorrectionAddReadout(pmShutterCorrectionData *data, ///< Correction data
     159                                   const pmReadout *readout, ///< Readout to add
     160                                   psStatsOptions meanStat, ///< Statistic to use for mean
     161                                   psStatsOptions stdevStat, ///< Statistic to use for stdev
     162                                   psMaskType maskVal, ///< Mask value
     163                                   psRandom *rng ///< Random number generator
     164    );
     165
     166/// Calculate the reference shutter time from the correction data
     167float pmShutterCorrectionReference(const pmShutterCorrectionData *data ///< Correction data
     168    );
     169
     170/// Generate a shutter correction
     171///
     172/// Performs the linear fit to each pixel in the stack.
     173bool pmShutterCorrectionGenerate(pmReadout *shutter, ///< Shutter correction
     174                                 pmReadout *pattern, ///< Background pattern (or NULL)
     175                                 const psArray *inputs, ///< Stack of input pmReadouts
     176                                 float reference, ///< Reference shutter time (from pmShutterCorrectionRef)
     177                                 const pmShutterCorrectionData *data, ///< Correction data
     178                                 int nIter, ///< Number of iterations
     179                                 float rej, ///< Rejection threshold (sigma)
     180                                 psMaskType maskVal ///< Mask value
     181    );
     182
     183
     184
    130185/// @}
    131186#endif
Note: See TracChangeset for help on using the changeset viewer.