IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2008, 5:10:17 PM (18 years ago)
Author:
Paul Price
Message:

Merging pap_branch_080328 so we can use the modernised version of ppMerge.

File:
1 edited

Legend:

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

    r13870 r17228  
    55 * @author Paul Price, IfA
    66 *
    7  * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-06-19 03:40:48 $
     7 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2008-03-29 03:10:17 $
    99 * Copyright 2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    6161
    6262/// Shutter correction parameters, applicable for a single pixel
    63 typedef struct
    64 {
     63typedef struct {
    6564    double scale;                       ///< The normalisation for an exposure, A(k)
    6665    double offset;                      ///< The time offset, dTk
    6766    double offref;                      ///< The reference time offset, dTo
    68 }
    69 pmShutterCorrection;
     67    int num;                            ///< Number of points used
     68    float stdev;                        ///< Standard deviation
     69} pmShutterCorrection;
    7070
    7171/// Allocator for shutter correction parameters
     
    7676/// This function is used before doing the full non-linear fit, to get parameters close to the true.  Assumes
    7777/// exptime vector is sorted (ascending order; longest is last) prior to input.
    78 pmShutterCorrection *pmShutterCorrectionGuess(const psVector *exptime, ///< Exposure times for each exposure
    79         const psVector *counts ///< Counts for each exposure
    80                                              );
     78pmShutterCorrection *pmShutterCorrectionGuess(
     79    const psVector *exptime,            ///< Exposure times for each exposure
     80    const psVector *counts              ///< Counts for each exposure
     81    );
    8182
    8283/// Generate shutter correction based on a linear fit
     
    8485/// Performs a linear fit to counts as a function of exposure time, with the reference time offset fixed (so
    8586/// that the system is linear).  Performs iterative clipping, if nIter > 1.
    86 pmShutterCorrection *pmShutterCorrectionLinFit(const psVector *exptime, ///< Exposure times for each exposure
    87         const psVector *counts, ///< Counts for each exposure
    88         const psVector *cntError, ///< Error in the counts
    89         const psVector *mask, ///< Mask for each exposure
    90         float offref, ///< Reference time offset
    91         int nIter, ///< Number of iterations
    92         float rej, ///< Rejection threshold (sigma)
    93         psMaskType maskVal ///< Mask value
    94                                               );
     87pmShutterCorrection *pmShutterCorrectionLinFit(
     88    const psVector *exptime,            ///< Exposure times for each exposure
     89    const psVector *counts,             ///< Counts for each exposure
     90    const psVector *cntError,           ///< Error in the counts
     91    const psVector *mask,               ///< Mask for each exposure
     92    float offref,                       ///< Reference time offset
     93    int nIter,                          ///< Number of iterations
     94    float rej,                          ///< Rejection threshold (sigma)
     95    psMaskType maskVal                  ///< Mask value
     96    );
    9597
    9698/// Generate shutter correction based on a full non-linear fit
     
    99101/// the reference time offset, so that future fits may be performed using linear fitting with the reference
    100102/// time offset fixed.
    101 pmShutterCorrection *pmShutterCorrectionFullFit(const psVector *exptime, ///< Exposure times for each exposure
    102         const psVector *counts, ///< Counts for each exposure
    103         const psVector *cntError, ///< Error in the counts
    104         const pmShutterCorrection *guess ///< Initial guess
    105                                                );
     103pmShutterCorrection *pmShutterCorrectionFullFit(
     104    const psVector *exptime,            ///< Exposure times for each exposure
     105    const psVector *counts,             ///< Counts for each exposure
     106    const psVector *cntError,           ///< Error in the counts
     107    const pmShutterCorrection *guess    ///< Initial guess
     108    );
    106109
    107110/// Measure a shutter correction image from an array of images
     
    111114/// measuring the reference time offset using the full non-linear fit for a small number of representative
    112115/// regions (middle and corners), and then using that to perform a linear fit to each pixel.
    113 bool pmShutterCorrectionMeasure(pmReadout *output, ///< Output readout
    114                                 const psArray *readouts, ///< Array of readouts
    115                                 int size, ///< Size of samples for statistics for non-linear fit
    116                                 psStatsOptions meanStat, ///< Statistic to use for mean
    117                                 psStatsOptions stdevStat, ///< Statistic to use for stdev
    118                                 int nIter, ///< Number of iterations
    119                                 float rej, ///< Rejection threshold (sigma)
    120                                 psMaskType maskVal ///< Mask value
     116bool pmShutterCorrectionMeasure(
     117    pmReadout *output,                  ///< Output readout
     118    const psArray *readouts,            ///< Array of readouts
     119    int size,                           ///< Size of samples for statistics for non-linear fit
     120    psStatsOptions meanStat,            ///< Statistic to use for mean
     121    psStatsOptions stdevStat,           ///< Statistic to use for stdev
     122    int nIter,                          ///< Number of iterations
     123    float rej,                          ///< Rejection threshold (sigma)
     124    psMaskType maskVal                  ///< Mask value
    121125    );
    122126
     
    124128///
    125129/// Given a shutter correction (with dT for each pixel), applies this correction to an input image.
    126 bool pmShutterCorrectionApply(pmReadout *readout, ///< Readout to which to apply shutter correction
    127                               const pmReadout *shutter ///< Shutter correction readout, with dT for each pixel
    128                              );
     130bool pmShutterCorrectionApply(
     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
     134    );
    129135
    130136//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    156162///
    157163/// Performs statistics on the readout, recording the data
    158 bool 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
     164bool pmShutterCorrectionAddReadout(
     165    pmShutterCorrectionData *data,      ///< Correction data
     166    const pmReadout *readout,           ///< Readout to add
     167    psStatsOptions meanStat,            ///< Statistic to use for mean
     168    psStatsOptions stdevStat,           ///< Statistic to use for stdev
     169    psMaskType maskVal,                 ///< Mask value
     170    psRandom *rng                       ///< Random number generator
    164171    );
    165172
    166173/// Calculate the reference shutter time from the correction data
    167 float pmShutterCorrectionReference(const pmShutterCorrectionData *data ///< Correction data
     174float pmShutterCorrectionReference(
     175    const pmShutterCorrectionData *data ///< Correction data
    168176    );
    169177
     
    171179///
    172180/// Performs the linear fit to each pixel in the stack.
    173 bool 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
     181bool pmShutterCorrectionGenerate(
     182    pmReadout *shutter,                 ///< Shutter correction
     183    pmReadout *pattern,                 ///< Background pattern (or NULL)
     184    const psArray *inputs,              ///< Stack of input pmReadouts
     185    float reference,                    ///< Reference shutter time (from pmShutterCorrectionRef)
     186    const pmShutterCorrectionData *data, ///< Correction data
     187    int nIter,                          ///< Number of iterations
     188    float rej,                          ///< Rejection threshold (sigma)
     189    psMaskType maskVal                  ///< Mask value
    181190    );
    182191
Note: See TracChangeset for help on using the changeset viewer.