/* @file  psClip.h
 * @brief vector clipping functions
 *
 * $Revision: 1.2 $ $Name: not supported by cvs2svn $
 * $Date: 2007-01-23 22:47:23 $
 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
 */

#ifndef PS_CLIP_H
#define PS_CLIP_H

/// @addtogroup MathOps Mathematical Operations
/// @{

/// 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
