# flagdata

##

Last updated Sun Sep 19 14:20:38 1999

Flag data

## 1. SYNOPSIS

[data, flags] = flagdata(data, lim, options )

## 2. DESCRIPTION

This function parses the input data and flags them as bad according to specified limits. A limit is specified by a vector with the following values:

1. Minimum value allowed
2. Maximum value allowed
3. Kind of limit to apply. Possible values are
   -1

     Data must lie outside intervall specified by minimal and maximal values.

   +1

     Data must lie inside intervall specified by minimal and maximal values.

This function returns a list of flags for each data being tested. These have the following meaning:

-Inf

  Corresponding data was less than minimal value,and limit mode was inside.

+Inf

  Corresponding data was more than maximal value,and limit mode was inside.

1

  Corresponding data passed the limit test.

0

  Corresponding data was inside intervall,but limit mode was set to outside.

NaN

  Corresponding data was already set to NaN on input.

## 3. PARAMETERS

data

  Array (MxN) of M variables,with N different values that should be flagged.

lim

  Array (Mx3) specifying the limits for the M variables.

options keyword , value

  The rest of the arguments is a list of options. See below for implemented options.

## 4. OPTIONS

Implemented options are:

-hdg vector

  Non-NaN values in the specified vector correspond to column numbers in data containing heading values. These are converted within 0 and 360 before applying the limit tests.

## 5. RETURNS

data

  Array (MxN),with all data not passing the limit test set to NaN.

flags Array (MxN) with the flags valeus resulting from the limit tests

  as described above.

## 6. AUTHORS

Pierre Jaccard, Geophysical Institute, University of Bergen, 1999