MGH_N_RUNS Name
MGH_N_RUNS Purpose
This function returns information about the data runs in an array.
Runs are defined as contiguous regions of non-zero data. The
function returns the number of runs; optional parameters return
information about the position & length of each run. The function
is useful for processing coastline data.
Calling Sequence
result = MGH_N_RUNS(array[, start, length])
Positional Parameters
array (input, numeric array)
Input data, treated as 1-D.
start (output, integer vector)
The index at which each run starts. This parameter is given a
value only if the return value is greater than 0. Its number of
elements is equal to return value.
length (output, integer vector)
The number of contiguous values in each run. This parameter is
given a value only if the return value is greater than 0. Its
number of elements is equal to return value.
Return Value
The function returns the number of runs.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield, 1995-12:
Written as N_RUNS.
Mark Hadfield, 2001-02:
Renamed MGH_N_RUNS and modified for IDL2 syntax.
Mark Hadfield, 2001-10:
WARNING: this change is not backward compatible! The input array
is now tested for non-zero values rather than for finite values
as previously. Code which called mgh_n_runs(x) for a real array
x should now call mgh_n_runs(finite(x)); code which called the
companion function mgh_n_holes(x) should now call
mgh_n_runs(~ finite(x))
Mark Hadfield, 2004-12:
Updated.