NAME¶
minmax - Find extreme values in data tables
SYNOPSIS¶
minmax [
files] [
-C ] [
-EL|
l|
H|
h col ] [
-H[
i][
nrec] ] [
-I[
p]
dx[/
dy[/
dz...] ] [
-S[
x][
y] ] [
-Tdz[/
col] ] [
-:[
i|
o] ] [
-bi[
s|
S|
d|
D[
ncol]|
c[
var1 /...]] ] [
-f[
i|
o]
colinfo ] [
-m[
i|
o][
flag] ]
DESCRIPTION¶
minmax reads its standard input [or from files] and finds the extreme
values in each of the columns. It recognizes NaNs and will print warnings if
the number of columns vary from record to record. As an option,
minmax
will find the extent of the first
n columns rounded up and down to the
nearest multiple of the supplied increments. By default, this output will be
in the form
-Rw/e/s/n which can be used directly in the command
line for other programs (hence only
dx and
dy are needed), or
the output will be in column form for as many columns as there are increments
provided. A similar option (
-T) will provide a
-Tzmin/zmax/dz string for makecpt.
- xyzfile
- ASCII [or binary, see -b] file(s) holding a fixed
number of data columns.
OPTIONS¶
- -C
- Report the min/max values per column in separate columns
[Default uses <min/max> format].
- -E
- Returns the record whose column col contains the
minimum ( l) or maximum (h) value. Upper case ( L|H)
works on absolute value of the data. In case of multiple matches, only the
first record is returned.
- -H
- Input file(s) has header record(s). If used, the default
number of header records is N_HEADER_RECS. Use -Hi if only
input data should have header records [Default will write out header
records if the input data have them]. Blank lines and lines starting with
# are always skipped.
- -I
- Report the min/max of the first n columns to the
nearest multiple of the provided increments (separate the n
increments by slashes), and output results in the form
-Rw/e/s/n (unless -C is set). If only one increment
is given we also use it for the second column (for backwards
compatibility). To override this behaviour, use -Ipdx.
- -S
- Add extra space for error bars. Useful together with
-I option and when later plotting with psxy -E.
-Sx leaves space for horizontal error bars using the values in
third (2) column. -Sy leaves space for vertical error bars using
the values in third (2) column. -S or -Sxy leaves space for
both error bars using the values in third and fourth (2 and 3)
columns.
- -T
- Report the min/max of the first (0'th) column to the
nearest multiple of dz and output this in the form
-Tzmin/zmax/dz. To use another column, append /
col.
- -:
- Toggles between (longitude,latitude) and
(latitude,longitude) input and/or output. [Default is
(longitude,latitude)]. Append i to select input only or o to
select output only. [Default affects both]. Only works when -I is
selected.
- -bi
- Selects binary input. Append s for single precision
[Default is d (double)]. Uppercase S or D will force
byte-swapping. Optionally, append ncol, the number of columns in
your binary input file if it exceeds the columns needed by the program. Or
append c if the input file is netCDF. Optionally, append
var1 /var2/... to specify the variables
to be read. [Default is 2 input columns].
- -f
- Special formatting of input and/or output columns (time or
geographical data). Specify i or o to make this apply only
to input or output [Default applies to both]. Give one or more columns (or
column ranges) separated by commas. Append T (absolute calendar
time), t (relative time in chosen TIME_UNIT since
TIME_EPOCH), x (longitude), y (latitude), or f
(floating point) to each column or column range item. Shorthand
-f[i|o]g means
-f[i|o]0x,1y (geographic
coordinates).
- -m
- Multiple segment file(s). Segments are separated by a
special record. For ASCII files the first character must be flag
[Default is '>']. For binary files all fields must be NaN and -b
must set the number of output columns explicitly. By default the -m
setting applies to both input and output. Use -mi and -mo to
give separate settings to input and output.
The ASCII output formats of numerical data are controlled by parameters in your
.gmtdefaults4 file. Longitude and latitude are formatted according to
OUTPUT_DEGREE_FORMAT, whereas other values are formatted according to
D_FORMAT. Be aware that the format in effect can lead to loss of
precision in the output, which can lead to various problems downstream. If you
find the output is not written with enough precision, consider switching to
binary output (
-bo if available) or specify more decimals using the
D_FORMAT setting.
EXAMPLES¶
To find the extreme values in the file ship_gravity.xygd:
minmax ship_gravity.xygd
Output should look like
ship_gravity.xygd: N = 6992 <326.125/334.684> <-28.0711/-8.6837>
<-47.7/177.6> <0.6/3544.9>
To find the extreme values in the file track.xy to the nearest 5 units and use
this region to draw a line using psxy, run
psxy `
minmax -I5 track.xy` track.xy
-Jx1
-B5
-P > track.ps
To find the min and max values for each of the first 4 columns, but rounded to
integers, use
minmax junkfile
-C -I1/1/1/1
BUGS¶
The
-I option does not yet work properly with time series data (e.g.,
-f0T). Thus, such variable intervals as months and years are not
calculated. Instead, specify your interval in the same units as the current
setting of
TIME_UNIT.
SEE ALSO¶
GMT(1)