00001 /* @file pmBias.h 00002 * @brief Subtract the overscan, bias and dark 00003 * 00004 * @author George Gusciora, MHPCC 00005 * @author Paul Price, IfA 00006 * 00007 * @version $Revision: 1.3 $ $Name: $ 00008 * @date $Date: 2007/01/24 02:54:15 $ 00009 * Copyright 2004--2006 Institute for Astronomy, University of Hawaii 00010 */ 00011 00012 #ifndef PM__BIAS_H 00013 #define PM__BIAS_H 00014 00015 /// @addtogroup detrend Detrend Creation and Application 00016 /// @{ 00017 00018 #include <pslib.h> 00019 00020 #include "pmFPA.h" 00021 00022 /// Type of fit to perform 00023 typedef enum { 00024 PM_FIT_NONE, ///< No fit 00025 PM_FIT_POLY_ORD, ///< Fit ordinary polynomial 00026 PM_FIT_POLY_CHEBY, ///< Fit Chebyshev polynomial 00027 PM_FIT_SPLINE ///< Fit cubic splines 00028 } pmFit; 00029 00030 /// Options for overscan subtraction 00031 /// 00032 /// The overscan subtraction may be performed by reducing all overscan regions to a single value (e.g., if 00033 /// there is no structure); or the overscan may be fit perpendicular to the read direction (usually the 00034 /// columns) with a particular functional form; or a single value may be subtracted for each read/scan without 00035 /// fitting (if the structure defies characterisation). In any case, statistics are required to reduce 00036 /// multiple values to a single value (either for the scan, or for the entire overscan regions). 00037 typedef struct 00038 { 00039 // Inputs 00040 bool single; ///< Reduce all overscan regions to a single value? 00041 pmFit fitType; ///< Type of fit to overscan 00042 unsigned int order; ///< Order of polynomial, or number of spline pieces 00043 psStats *stat; ///< Statistic to use when reducing the minor direction 00044 // Outputs 00045 psPolynomial1D *poly; ///< Result of polynomial fit 00046 psSpline1D *spline; ///< Result of spline fit 00047 } 00048 pmOverscanOptions; 00049 00050 /// Allocator for overscan options 00051 pmOverscanOptions *pmOverscanOptionsAlloc(bool single, ///< Reduce all overscan regions to a single value? 00052 pmFit fitType, ///< Type of fit to overscan 00053 unsigned int order, ///< Order of polynomial, or number of splines 00054 psStats *stat ///< Statistic to use 00055 ); 00056 00057 /// Subtract the overscan, bias and/or dark 00058 /// 00059 /// Subtracts the overscan, as measured from the bias member of the input readout (if options are non-NULL), 00060 /// bias (if non-NULL) and dark (if non-NULL) scaled by the CELL.DARKTIME concept. 00061 bool pmBiasSubtract(pmReadout *in, ///< Input readout, to be overscan/bias/dark corrected 00062 pmOverscanOptions *overscanOpts, ///< Options for overscan subtraction, or NULL 00063 const pmReadout *bias, ///< Bias image to subtract, or NULL 00064 const pmReadout *dark ///< Dark image to scale and subtract, or NULL 00065 ); 00066 00067 /// @} 00068 #endif
1.5.1