IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 215


Ignore:
Timestamp:
Mar 11, 2004, 10:34:23 AM (22 years ago)
Author:
eugene
Message:

added psStats and psPolynomial2D structures & support

Location:
trunk/archive/pslib/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psImages.h

    r206 r215  
    7474              int ny,                   ///< width of region in y
    7575              int direction,            ///< direction of vector along slice
    76               psStatMode statmode       ///< statistic applied to pixel group to find output value
     76              psStats *stats            ///< defines statistics used to find output values
    7777);
    7878
     
    8585            float ye,                   ///< ending y coord of cut
    8686            float dw,                   ///< width of cut
    87             psStatMode statmode         ///< statistic applied to pixel group to find output value
     87            psStats *stats              ///< defines statistics used to find output values
    8888    );
    8989
     
    9595                  float radius,         ///< outer radius of annulii
    9696                  float dr,             ///< radial step size of annulii
    97                   psStatMode statmode   ///< statistic applied to pixel group to find output value
     97                  psStats *stats                ///< defines statistics used to find output values
    9898    );
    9999
     
    110110psImageRebin (psImage *input,           ///< rebin this image
    111111              float scale,              ///< rebinning scale: doutput = scale*dinput
    112               psStatMode statmode       ///< statistic used in performing interpolation / summing
     112              psStats *stats            ///< defines statistics used to find output values
    113113);
    114114
     
    137137
    138138/// Determine statistics for image (or subimage).
    139 /// Should we have one function for all stats, or multiple functions?
    140 /// How to represent the output values?
    141 void
    142 psImageGetStats (psImage *input, psStatMode statmode);
     139psStats *
     140psImageGetStats (psImage *input,        ///< image (or subimage) to calculate stats
     141                 psStats *stats);       ///< defines statistics to be calculated
    143142
    144143/// Construct a histogram from an image (or subimage).
     
    149148
    150149/// Fit a 2-D polynomial surface to an image.
    151 psFloatArrayArray *
     150psPolynomial2D *
    152151psImageFitPolynomial (psImage *input,   ///< image to fit
    153                       int xorder,       ///< order of polynomial in x-dir
    154                       int yorder        ///< order of polynomial in y-dir
     152                      psPolynomial2D *coeffs ///< coefficient structure carries in desired terms
     153);
     154
     155/// Evaluate a 2-D polynomial surface to image pixels.
     156int
     157psImageEvalPolynomial (psImage *input,  ///< image to fit
     158                       psPolynomial2D *coeffs ///< coefficient structure carries in desired terms
    155159);
    156160
  • trunk/archive/pslib/include/psStats.h

    r160 r215  
    55#include "psStdArrays.h"
    66
     7typedef enum {
     8    PS_STAT_SAMPLE_MEAN           = 0x000001,
     9    PS_STAT_SAMPLE_MEAN_ERROR     = 0x000002,
     10    PS_STAT_SAMPLE_MEDIAN         = 0x000004,
     11    PS_STAT_SAMPLE_MEDIAN_ERROR   = 0x000008,
     12    PS_STAT_SAMPLE_STDEV          = 0x000010,
     13    PS_STAT_SAMPLE_UQ             = 0x000020,
     14    PS_STAT_SAMPLE_LQ             = 0x000040,
     15    PS_STAT_ROBUST_MEAN           = 0x000080,
     16    PS_STAT_ROBUST_MEAN_ERROR     = 0x000100,
     17    PS_STAT_ROBUST_MEAN_NVALUES   = 0x000200,
     18    PS_STAT_ROBUST_MEDIAN         = 0x000400,
     19    PS_STAT_ROBUST_MEDIAN_ERROR   = 0x000800,
     20    PS_STAT_ROBUST_MEDIAN_NVALUES = 0x001000,
     21    PS_STAT_ROBUST_STDEV          = 0x002000,
     22    PS_STAT_ROBUST_UQ             = 0x004000,
     23    PS_STAT_ROBUST_LQ             = 0x008000,
     24    PS_STAT_CLIPPED_MEAN          = 0x010000,
     25    PS_STAT_CLIPPED_MEAN_ERROR    = 0x020000,
     26    PS_STAT_CLIPPED_MEAN_NVALUES  = 0x040000,
     27    PS_STAT_CLIPPED_MEAN_NSIGMA   = 0x080000,
     28    PS_STAT_MAX                   = 0x100000,     
     29    PS_STAT_MIN                   = 0x200000,
     30    PS_STAT_NVALUES               = 0x400000
     31} psStatsOptions;                         
     32
     33/** generic statistics structure */
     34typedef struct {
     35    double sampleMean                   //<! formal mean of sample
     36    double sampleMeanError;             //<! error on formal mean
     37    double sampleMedian                 //<! formal median of sample
     38    double sampleMedianError;           //<! error on formal median
     39    double sampleStdev;                 //<! standard deviation of sample
     40    double sampleUQ;                    //<! upper quartile of sample
     41    double sampleLQ;                    //<! lower quartile of sample
     42    double robustMean                   //<! robust mean of array
     43    double robustMeanError;             //<! error on robust mean
     44    int    robustMeanNvalues;           //<! number of measurements used for robust mean
     45    double robustMedian                 //<! robust median of array
     46    double robustMedianError;           //<! error on robust median
     47    int    robustMedianNvalues;         //<! number of measurements used for robust median
     48    double robustStdev;                 //<! robust standard deviation of array
     49    double robustUQ;                    //<! robust upper quartile
     50    double robustLQ;                    //<! robust lower quartile
     51    double clippedMean                  //<! Nsigma clipped mean
     52    double clippedMeanError;            //<! error on clipped mean
     53    int    clippedMeanNvalues;          //<! number of data points used for clipped mean
     54    double clippedMeanNsigma;           //<! Nsigma clip used for clipped mean
     55    double min;                         //<! minimum data value in array
     56    double max;                         //<! maximum data value in array
     57    int    nValues;                     //<! number of data values in array
     58    psStatsOptions options;             //<! bitmask of calculated values
     59} psStats;
     60
     61
    762/** Do Statistics on an array.  Returns a status value. */
    8 int
     63psStats *
    964psArrayStats(const psFloatArray *restrict myArray, //!< Array to be analysed
    1065             const psIntArray *restrict maskArray, //!< Ignore elements where (maskArray & maskVal) != 0
    1166                                                   //!< May be NULL
    1267             unsigned int maskVal,      //!< Only mask elements with one of these bits set in maskArray
    13              int numIter,               //!< Number of clipping iterations (0 not to clip)
    14              float numSD,               //!< Number of s.d. to clip at
    15              float *restrict mean,      //!< Mean of array (or NULL)
    16              float *restrict sd,        //!< Standard deviation (or NULL)
    17              float *restrict med        //!< Median (or NULL)
    18              );
     68             psStats *stats             //!< stats structure defines stats to be calculated and how
     69);
    1970
    2071/***********************************************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.