IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 13, 2024, 10:19:51 PM (22 months ago)
Author:
hgao
Message:

finetune overscan region and stats for reducing and smoothing overscan array/vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2dbias/psLib/src/math/psStats.h

    r31152 r42719  
    2727 *  @see psStats, psVectorStats, psImageStats
    2828 */
    29 typedef enum {
    30     PS_STAT_NONE            = 0x000000, ///< Empty set
    31     PS_STAT_MIN             = 0x000001, ///< Maximum
    32     PS_STAT_MAX             = 0x000002, ///< Minumum
    33     PS_STAT_SAMPLE_MEAN     = 0x000004, ///< Sample Mean
    34     PS_STAT_SAMPLE_MEDIAN   = 0x000008, ///< Sample Median
    35     PS_STAT_SAMPLE_STDEV    = 0x000010, ///< Sample Standard Deviation
    36     PS_STAT_SAMPLE_QUARTILE = 0x000020, ///< Sample Quartile
    37     PS_STAT_SAMPLE_SKEWNESS = 0x000040, ///< Sample Skewness (third moment)
    38     PS_STAT_SAMPLE_KURTOSIS = 0x000080, ///< Sample Kurtosis (fourth moment)
    39     PS_STAT_ROBUST_MEDIAN   = 0x000100, ///< Robust Median
    40     PS_STAT_ROBUST_STDEV    = 0x000200, ///< Robust Standarad Deviation
    41     PS_STAT_ROBUST_QUARTILE = 0x000400, ///< Robust Quartile
    42     PS_STAT_ROBUST_SPARE1   = 0x000800, ///< Spare 1
    43     PS_STAT_FITTED_MEAN     = 0x001000, ///< Fitted Mean
    44     PS_STAT_FITTED_STDEV    = 0x002000, ///< Fitted Standard Deviation
    45     PS_STAT_CLIPPED_MEAN    = 0x040000, ///< Clipped Mean
    46     PS_STAT_CLIPPED_STDEV   = 0x080000, ///< Clipped Standard Deviation
    47     PS_STAT_USE_RANGE       = 0x100000, ///< Range
    48     PS_STAT_USE_BINSIZE     = 0x200000, ///< Binsize
     29typedef enum
     30{
     31  PS_STAT_NONE = 0x000000,            ///< Empty set
     32  PS_STAT_MIN = 0x000001,             ///< Maximum
     33  PS_STAT_MAX = 0x000002,             ///< Minumum
     34  PS_STAT_SAMPLE_MEAN = 0x000004,     ///< Sample Mean
     35  PS_STAT_SAMPLE_MEDIAN = 0x000008,   ///< Sample Median
     36  PS_STAT_SAMPLE_STDEV = 0x000010,    ///< Sample Standard Deviation
     37  PS_STAT_SAMPLE_QUARTILE = 0x000020, ///< Sample Quartile
     38  PS_STAT_SAMPLE_SKEWNESS = 0x000040, ///< Sample Skewness (third moment)
     39  PS_STAT_SAMPLE_KURTOSIS = 0x000080, ///< Sample Kurtosis (fourth moment)
     40  PS_STAT_ROBUST_MEDIAN = 0x000100,   ///< Robust Median
     41  PS_STAT_ROBUST_STDEV = 0x000200,    ///< Robust Standarad Deviation
     42  PS_STAT_ROBUST_QUARTILE = 0x000400, ///< Robust Quartile
     43  PS_STAT_ROBUST_SPARE1 = 0x000800,   ///< Spare 1
     44  PS_STAT_FITTED_MEAN = 0x001000,     ///< Fitted Mean
     45  PS_STAT_FITTED_STDEV = 0x002000,    ///< Fitted Standard Deviation
     46  PS_STAT_CLIPPED_MEDIAN = 0x020000,  ///< Clipped Median
     47  PS_STAT_CLIPPED_MEAN = 0x040000,    ///< Clipped Mean
     48  PS_STAT_CLIPPED_STDEV = 0x080000,   ///< Clipped Standard Deviation
     49  PS_STAT_USE_RANGE = 0x100000,       ///< Range
     50  PS_STAT_USE_BINSIZE = 0x200000,     ///< Binsize
    4951} psStatsOptions;
    5052
     
    5456typedef struct
    5557{
    56     double sampleMean;                 ///< formal mean of sample
    57     double sampleMedian;               ///< formal median of sample
    58     double sampleStdev;                ///< standard deviation of sample
    59     double sampleUQ;                   ///< upper quartile of sample
    60     double sampleLQ;                   ///< lower quartile of sample
    61     double sampleSkewness;             ///< skewness (third moment) of sample
    62     double sampleKurtosis;             ///< kurtosis (fourth moment) of sample
    63     double robustMedian;               ///< robust median of array
    64     double robustStdev;                ///< robust standard deviation of array
    65     double robustUQ;                   ///< robust upper quartile
    66     double robustLQ;                   ///< robust lower quartile
    67     long robustN50;                    ///< Number of points in Gaussian fit; XXX: This is currently unused.
    68     double fittedMean;                 ///< robust mean of data
    69     double fittedStdev;                ///< robust standard deviation of data
    70     long fittedNfit;                   ///< Number of points in Gaussian fit; XXX: This is currently unused
    71     double clippedMean;                ///< Nsigma clipped mean
    72     double clippedStdev;               ///< standard deviation after clipping
    73     long clippedNvalues;               ///< Number of data points used for clipped mean.
    74     double clipSigma;                  ///< Nsigma used for clipping; user input
    75     int clipIter;                      ///< Number of clipping iterations; user input
    76     double min;                        ///< minimum data value in array
    77     double max;                        ///< maximum data value in array
    78     double binsize;                    ///< binsize for robust fit (input/ouput)
    79     long nSubsample;                   ///< maxinum number of measurements (input)
    80     psStatsOptions options;            ///< bitmask of values requested
    81     psStatsOptions results;            ///< bitmask of values calculated
    82     psVector *tmpData;                 ///< temporary vector so repeated calls do not have to realloc
    83     psVector *tmpMask;                 ///< temporary vector so repeated calls do not have to realloc
    84 }
    85 psStats;
     58  double sampleMean;      ///< formal mean of sample
     59  double sampleMedian;    ///< formal median of sample
     60  double sampleStdev;     ///< standard deviation of sample
     61  double sampleUQ;        ///< upper quartile of sample
     62  double sampleLQ;        ///< lower quartile of sample
     63  double sampleSkewness;  ///< skewness (third moment) of sample
     64  double sampleKurtosis;  ///< kurtosis (fourth moment) of sample
     65  double robustMedian;    ///< robust median of array
     66  double robustStdev;     ///< robust standard deviation of array
     67  double robustUQ;        ///< robust upper quartile
     68  double robustLQ;        ///< robust lower quartile
     69  long robustN50;         ///< Number of points in Gaussian fit; XXX: This is currently unused.
     70  double fittedMean;      ///< robust mean of data
     71  double fittedStdev;     ///< robust standard deviation of data
     72  long fittedNfit;        ///< Number of points in Gaussian fit; XXX: This is currently unused
     73  double clippedMean;     ///< Nsigma clipped mean
     74  double clippedMedian;   ///< Nsigma clipped median
     75  double clippedStdev;    ///< standard deviation after clipping
     76  long clippedNvalues;    ///< Number of data points used for clipped mean.
     77  double clipSigma;       ///< Nsigma used for clipping; user input
     78  int clipIter;           ///< Number of clipping iterations; user input
     79  double min;             ///< minimum data value in array
     80  double max;             ///< maximum data value in array
     81  double binsize;         ///< binsize for robust fit (input/ouput)
     82  long nSubsample;        ///< maxinum number of measurements (input)
     83  psStatsOptions options; ///< bitmask of values requested
     84  psStatsOptions results; ///< bitmask of values calculated
     85  psVector *tmpData;      ///< temporary vector so repeated calls do not have to realloc
     86  psVector *tmpMask;      ///< temporary vector so repeated calls do not have to realloc
     87} psStats;
    8688
    8789/** Performs statistical calculations on a vector.
     
    9092 */
    9193bool psVectorStats(
    92     psStats* stats,            ///< stats structure defines stats to be calculated and how
    93     const psVector* in,                 ///< Vector to be analysed.
    94     const psVector* errors,             ///< Errors.
    95     const psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
     94    psStats *stats,          ///< stats structure defines stats to be calculated and how
     95    const psVector *in,      ///< Vector to be analysed.
     96    const psVector *errors,  ///< Errors.
     97    const psVector *mask,    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    9698    psVectorMaskType maskVal ///< Only mask elements with one of these bits set in maskVector
    9799);
     
    103105 */
    104106#ifdef DOXYGEN
    105 psStats* psStatsAlloc(
    106     psStatsOptions options              ///< Statistics to calculate
     107psStats *psStatsAlloc(
     108    psStatsOptions options ///< Statistics to calculate
    107109);
    108110#else // ifdef DOXYGEN
    109 psStats* p_psStatsAlloc(
    110     const char *file,                   ///< File of caller
    111     unsigned int lineno,                ///< Line number of caller
    112     const char *func,                   ///< Function name of caller
    113     psStatsOptions options              ///< Statistics to calculate
    114 ) PS_ATTR_MALLOC;
     111psStats *p_psStatsAlloc(
     112    const char *file,      ///< File of caller
     113    unsigned int lineno,   ///< Line number of caller
     114    const char *func,      ///< Function name of caller
     115    psStatsOptions options ///< Statistics to calculate
     116    ) PS_ATTR_MALLOC;
    115117#define psStatsAlloc(options) \
    116       p_psStatsAlloc(__FILE__, __LINE__, __func__, options)
     118  p_psStatsAlloc(__FILE__, __LINE__, __func__, options)
    117119#endif // ifdef DOXYGEN
    118120
     
    124126 */
    125127bool psMemCheckStats(
    126     psPtr ptr                          ///< the pointer whose type to check
     128    psPtr ptr ///< the pointer whose type to check
    127129);
    128130
Note: See TracChangeset for help on using the changeset viewer.