IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2025, 3:33:01 PM (14 months ago)
Author:
tdeboer
Message:

updates to detrend functions for 2D overscan correction

File:
1 edited

Legend:

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

    r42379 r42889  
    1818
    1919/// Type of fit to perform
    20 typedef enum {
    21     PM_FIT_NONE,                        ///< No fit
    22     PM_FIT_POLY_ORD,                    ///< Fit ordinary polynomial
    23     PM_FIT_POLY_CHEBY,                  ///< Fit Chebyshev polynomial
    24     PM_FIT_SPLINE                       ///< Fit cubic splines
     20typedef enum
     21{
     22    PM_FIT_NONE,       ///< No fit
     23    PM_FIT_POLY_ORD,   ///< Fit ordinary polynomial
     24    PM_FIT_POLY_CHEBY, ///< Fit Chebyshev polynomial
     25    PM_FIT_SPLINE      ///< Fit cubic splines
    2526} pmFit;
    2627
     
    3536{
    3637    // Inputs
    37     bool single;                        ///< Reduce all overscan regions to a single value?
    38     bool constant;                      ///< use a supplied constant value (do not measure region)
    39     float value;                        ///< supplied value if needed (per above)
    40     pmFit fitType;                      ///< Type of fit to overscan
    41     unsigned int order;                 ///< Order of polynomial, or number of spline pieces
    42     psStats *stat;                      ///< Statistic to use when reducing the minor direction
    43     int boxcar;                         ///< Boxcar smoothing radius
    44     float gauss;                        ///< Gaussian smoothing sigma
    45     float minValid;                     ///< if overscan is too low, readout is dead : mask
    46     float maxValid;                     ///< if overscan is too high, readout is dead : mask
    47     psImageMaskType maskVal;            ///< Mask value to give dead readouts
     38    pmFit fitType;      ///< Type of fit to overscan
     39    unsigned int order; ///< Order of polynomial, or number of spline pieces
     40    psStats *stat;      ///< Statistic to use when reducing the minor direction
     41    int boxcar;         ///< Boxcar smoothing radius
     42    float gauss;        ///< Gaussian smoothing sigma
     43    psRegion biassecslow; ///< The 2D slow bias section
     44    psRegion biassecfast; ///< The 2D fast bias section
    4845
    49     // Outputs
    50     psPolynomial1D *poly;               ///< Result of polynomial fit
    51     psSpline1D *spline;                 ///< Result of spline fit
    52 }
    53 pmOverscanOptions;
     46   
     47    // These are used to carry the fitted functions, but are only used to generate
     48    // an updated reduced vector
     49    psPolynomial1D *poly; ///< Result of polynomial fit
     50    psSpline1D *spline;   ///< Result of spline fit
     51} pmOverscanStatOptions;
     52
     53/// Options for overscan subtraction
     54///
     55/// The overscan subtraction may be performed by reducing all overscan regions to a single value (e.g., if
     56/// there is no structure); or the overscan may be fit perpendicular to the read direction (usually the
     57/// columns) with a particular functional form; or a single value may be subtracted for each read/scan without
     58/// fitting (if the structure defies characterisation).  In any case, statistics are required to reduce
     59/// multiple values to a single value (either for the scan, or for the entire overscan regions).
     60typedef struct
     61{
     62    // Inputs
     63    bool single;             ///< Reduce all overscan regions to a single value?
     64    bool constant;           ///< use a supplied constant value (do not measure region)
     65    bool TwoD;               ///< use a supplied constant value (do not measure region)
     66    float value;             ///< supplied value if needed (per above)
     67    float minValid;          ///< if overscan is too low, readout is dead : mask
     68    float maxValid;          ///< if overscan is too high, readout is dead : mask
     69    psImageMaskType maskVal; ///< Mask value to give dead readouts
     70
     71    pmOverscanStatOptions *primary;
     72    pmOverscanStatOptions *secondary;
     73} pmOverscanOptions;
    5474
    5575/// Allocator for overscan options
    56 pmOverscanOptions *pmOverscanOptionsAlloc(bool single, ///< Reduce all overscan regions to a single value?
    57                                           pmFit fitType, ///< Type of fit to overscan
    58                                           unsigned int order, ///< Order of polynomial, or number of splines
    59                                           psStats *stat, ///< Statistic to use
    60                                           int boxcar, ///< Boxcar smoothing radius
    61                                           float gauss ///< Gaussian smoothing sigma
    62                                          );
     76pmOverscanOptions *pmOverscanOptionsAlloc(void);
    6377
    64 psVector *pmOverscanVector(float *chi2, // chi^2 from fit
    65                            pmOverscanOptions *overscanOpts, // Overscan options
    66                            const psArray *pixels, // Array of vectors containing the pixel values
    67                            psStats *myStats // Statistic to use in reducing the overscan
    68     );
     78pmOverscanStatOptions *pmOverscanStatOptionsAlloc(void);
    6979
    70 bool pmOverscanUpdateHeader (pmHDU *hdu, pmOverscanOptions *overscanOpts, float chi2);
     80psVector *pmOverscanVector(float *chi2,                         // chi^2 from fit
     81                           pmOverscanStatOptions *overscanOpts, // Overscan options
     82                           const psArray *pixels,               // Array of vectors containing the pixel values
     83                           bool robust                          // use robust statistics for boxcar smoothing
     84);
    7185
    72 bool pmOverscanSubtract (pmReadout *input, pmOverscanOptions *overscanOpts);
     86// bool pmOverscanUpdateHeader (pmHDU *hdu, pmOverscanOptions *overscanOpts, float chi2);
     87
     88bool pmOverscanSubtract(pmReadout *input, pmOverscanOptions *overscanOpts, bool doTwoDOverscan);
    7389
    7490/// @}
    7591#endif
    76 
Note: See TracChangeset for help on using the changeset viewer.