Changeset 215
- Timestamp:
- Mar 11, 2004, 10:34:23 AM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 2 edited
-
psImages.h (modified) (6 diffs)
-
psStats.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psImages.h
r206 r215 74 74 int ny, ///< width of region in y 75 75 int direction, ///< direction of vector along slice 76 psStat Mode statmode ///< statistic applied to pixel group to find output value76 psStats *stats ///< defines statistics used to find output values 77 77 ); 78 78 … … 85 85 float ye, ///< ending y coord of cut 86 86 float dw, ///< width of cut 87 psStat Mode statmode ///< statistic applied to pixel group to find output value87 psStats *stats ///< defines statistics used to find output values 88 88 ); 89 89 … … 95 95 float radius, ///< outer radius of annulii 96 96 float dr, ///< radial step size of annulii 97 psStat Mode statmode ///< statistic applied to pixel group to find output value97 psStats *stats ///< defines statistics used to find output values 98 98 ); 99 99 … … 110 110 psImageRebin (psImage *input, ///< rebin this image 111 111 float scale, ///< rebinning scale: doutput = scale*dinput 112 psStat Mode statmode ///< statistic used in performing interpolation / summing112 psStats *stats ///< defines statistics used to find output values 113 113 ); 114 114 … … 137 137 138 138 /// 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); 139 psStats * 140 psImageGetStats (psImage *input, ///< image (or subimage) to calculate stats 141 psStats *stats); ///< defines statistics to be calculated 143 142 144 143 /// Construct a histogram from an image (or subimage). … … 149 148 150 149 /// Fit a 2-D polynomial surface to an image. 151 ps FloatArrayArray*150 psPolynomial2D * 152 151 psImageFitPolynomial (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. 156 int 157 psImageEvalPolynomial (psImage *input, ///< image to fit 158 psPolynomial2D *coeffs ///< coefficient structure carries in desired terms 155 159 ); 156 160 -
trunk/archive/pslib/include/psStats.h
r160 r215 5 5 #include "psStdArrays.h" 6 6 7 typedef 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 */ 34 typedef 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 7 62 /** Do Statistics on an array. Returns a status value. */ 8 int 63 psStats * 9 64 psArrayStats(const psFloatArray *restrict myArray, //!< Array to be analysed 10 65 const psIntArray *restrict maskArray, //!< Ignore elements where (maskArray & maskVal) != 0 11 66 //!< May be NULL 12 67 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 ); 19 70 20 71 /***********************************************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.
