Changeset 17228 for trunk/psModules/src/detrend/pmShutterCorrection.h
- Timestamp:
- Mar 28, 2008, 5:10:17 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmShutterCorrection.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmShutterCorrection.h
r13870 r17228 5 5 * @author Paul Price, IfA 6 6 * 7 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $8 * @date $Date: 200 7-06-19 03:40:48$7 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-03-29 03:10:17 $ 9 9 * Copyright 2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 61 61 62 62 /// Shutter correction parameters, applicable for a single pixel 63 typedef struct 64 { 63 typedef struct { 65 64 double scale; ///< The normalisation for an exposure, A(k) 66 65 double offset; ///< The time offset, dTk 67 66 double offref; ///< The reference time offset, dTo 68 } 69 pmShutterCorrection; 67 int num; ///< Number of points used 68 float stdev; ///< Standard deviation 69 } pmShutterCorrection; 70 70 71 71 /// Allocator for shutter correction parameters … … 76 76 /// This function is used before doing the full non-linear fit, to get parameters close to the true. Assumes 77 77 /// 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 ); 78 pmShutterCorrection *pmShutterCorrectionGuess( 79 const psVector *exptime, ///< Exposure times for each exposure 80 const psVector *counts ///< Counts for each exposure 81 ); 81 82 82 83 /// Generate shutter correction based on a linear fit … … 84 85 /// Performs a linear fit to counts as a function of exposure time, with the reference time offset fixed (so 85 86 /// 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 ); 87 pmShutterCorrection *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 ); 95 97 96 98 /// Generate shutter correction based on a full non-linear fit … … 99 101 /// the reference time offset, so that future fits may be performed using linear fitting with the reference 100 102 /// 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 ); 103 pmShutterCorrection *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 ); 106 109 107 110 /// Measure a shutter correction image from an array of images … … 111 114 /// measuring the reference time offset using the full non-linear fit for a small number of representative 112 115 /// 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 116 bool 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 121 125 ); 122 126 … … 124 128 /// 125 129 /// 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 ); 130 bool 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 ); 129 135 130 136 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 156 162 /// 157 163 /// 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 164 bool 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 164 171 ); 165 172 166 173 /// Calculate the reference shutter time from the correction data 167 float pmShutterCorrectionReference(const pmShutterCorrectionData *data ///< Correction data 174 float pmShutterCorrectionReference( 175 const pmShutterCorrectionData *data ///< Correction data 168 176 ); 169 177 … … 171 179 /// 172 180 /// 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 181 bool 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 181 190 ); 182 191
Note:
See TracChangeset
for help on using the changeset viewer.
