vec_math
Class SigmaClip

java.lang.Object
  extended by vec_math.SigmaClip

public class SigmaClip
extends Object

A simple class that allows recursive sigma-clipping on an input vector.


Field Summary
static int MAX
          Default maximum number of recursions.
static double SIGMA3
          Default value of the sigma-clipping factor.
 
Constructor Summary
SigmaClip()
           
 
Method Summary
private static Statistic getStatistic(double[] input, List<Integer> ignore)
          Creates a statistic from all valid measures only.
static List<Integer> recurse(double[] input)
           
static List<Integer> recurse(double[] input, double sigfac)
           
static List<Integer> recurse(double[] input, double sigf, int nmax)
           
static List<Integer> recurse(double[] input, double sigfac, int nmax, double totfrac, double stepfrac, double sigmin)
          Does a recursive sigma-clipping.
static List<Integer> recurse(double[] input, int nmax)
           
static List<Integer> single(double[] input, List<Integer> ignore, double sigfac)
          Does a single clip.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGMA3

public static final double SIGMA3
Default value of the sigma-clipping factor.

See Also:
Constant Field Values

MAX

public static final int MAX
Default maximum number of recursions.

See Also:
Constant Field Values
Constructor Detail

SigmaClip

public SigmaClip()
Method Detail

recurse

public static List<Integer> recurse(double[] input)

recurse

public static List<Integer> recurse(double[] input,
                                    double sigfac)

recurse

public static List<Integer> recurse(double[] input,
                                    int nmax)

recurse

public static List<Integer> recurse(double[] input,
                                    double sigf,
                                    int nmax)

recurse

public static List<Integer> recurse(double[] input,
                                    double sigfac,
                                    int nmax,
                                    double totfrac,
                                    double stepfrac,
                                    double sigmin)
Does a recursive sigma-clipping. Values in the arguments equal to zero indicate that this parameter is without bounds. The returned list is the list from the rejection step just before the condition became true. E.g. if in the fifth iteration, suddenly 20% of the values would be ignored, than we return the rejection list from the fourth step.

Parameters:
sigfac - Only values within those sigmas are allowed (3=def)
nmax - The maximum number of clipping recursions.
totfrac - maximum fraction of rejected points, from original.
stepfrac - maximum fraction of rejected points in single step.
sigmin - Stop, if the final standard deviation drops below.
Returns:
The invalidated indices in the original data set.

single

public static List<Integer> single(double[] input,
                                   List<Integer> ignore,
                                   double sigfac)
Does a single clip.


getStatistic

private static Statistic getStatistic(double[] input,
                                      List<Integer> ignore)
Creates a statistic from all valid measures only. input may not be null.