#ifndef PS_CLIP_H
#define PS_CLIP_H

/// Parameters for clipping
typedef struct
{
    psStatsOptions meanStat;            ///< Stats option to use for mean
    psStatsOptions stdevStat;           ///< Stats option to use for standard deviation
    float fracHigh;                     ///< Fraction of high values to clip
    float fracLow;                      ///< Fraction of low values to clip
    int numKeep;                        ///< Minimum number of values to keep from clipping
    int iter;                           ///< Number of rejection iterations
    float rej;                          ///< Rejection limit (standard deviations)
    psMaskType masked;                  ///< Mask value for entries already masked
    psMaskType clipped;                 ///< Mask value to give to clipped entries
    float mean;                         ///< Resultant mean
    float stdev;                        ///< Resultant stdev
}
psClipParams;


long psClip(psClipParams *params,       ///< Clip parameters
            psVector *values,           ///< Values to inspect and clip
            psVector *mask,             ///< Mask for values
            const psVector *errors      ///< Errors for values
           );

#endif
