1MINMAX(1) Generic Mapping Tools MINMAX(1)
2
3
4
6 minmax - Find extreme values in data tables
7
9 minmax [ files] [ -C ] [ -EL|l|H|hcol ] [ -H[i][nrec] ] [
10 -I[p]dx[/dy[/dz...] ] [ -S[x][y] ] [ -Tdz[/col] ] [ -:[i|o] ] [
11 -bi[s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ] [ -m[i|o][flag] ]
12
14 minmax reads its standard input [or from files] and finds the extreme
15 values in each of the columns. It recognizes NaNs and will print warn‐
16 ings if the number of columns vary from record to record. As an
17 option, minmax will find the extent of the first n columns rounded up
18 and down to the nearest multiple of the supplied increments. By
19 default, this output will be in the form -Rw/e/s/n which can be used
20 directly in the command line for other programs (hence only dx and dy
21 are needed), or the output will be in column form for as many columns
22 as there are increments provided. A similar option (-T) will provide a
23 -Tzmin/zmax/dz string for makecpt.
24
25 xyzfile
26 ASCII [or binary, see -b] file(s) holding a fixed number of data
27 columns.
28
30 -C Report the min/max values per column in separate columns
31 [Default uses <min/max> format].
32
33 -E Returns the record whose column col contains the minimum (l) or
34 maximum (h) value. Upper case (L|H) works on absolute value of
35 the data. In case of multiple matches, only the first record is
36 returned.
37
38 -H Input file(s) has header record(s). If used, the default number
39 of header records is N_HEADER_RECS. Use -Hi if only input data
40 should have header records [Default will write out header
41 records if the input data have them]. Blank lines and lines
42 starting with # are always skipped.
43
44 -I Report the min/max of the first n columns to the nearest multi‐
45 ple of the provided increments (separate the n increments by
46 slashes), and output results in the form -Rw/e/s/n (unless -C is
47 set). If only one increment is given we also use it for the
48 second column (for backwards compatibility). To override this
49 behaviour, use -Ipdx.
50
51 -S Add extra space for error bars. Useful together with -I option
52 and when later plotting with psxy -E. -Sx leaves space for hor‐
53 izontal error bars using the values in third (2) column. -Sy
54 leaves space for vertical error bars using the values in third
55 (2) column. -S or -Sxy leaves space for both error bars using
56 the values in third and fourth (2 and 3) columns.
57
58 -T Report the min/max of the first (0'th) column to the nearest
59 multiple of dz and output this in the form -Tzmin/zmax/dz. To
60 use another column, append /col.
61
62 -: Toggles between (longitude,latitude) and (latitude,longitude)
63 input and/or output. [Default is (longitude,latitude)]. Append
64 i to select input only or o to select output only. [Default
65 affects both]. Only works when -I is selected.
66
67 -bi Selects binary input. Append s for single precision [Default is
68 d (double)]. Uppercase S or D will force byte-swapping.
69 Optionally, append ncol, the number of columns in your binary
70 input file if it exceeds the columns needed by the program. Or
71 append c if the input file is netCDF. Optionally, append
72 var1/var2/... to specify the variables to be read. [Default is
73 2 input columns].
74
75 -f Special formatting of input and/or output columns (time or geo‐
76 graphical data). Specify i or o to make this apply only to
77 input or output [Default applies to both]. Give one or more
78 columns (or column ranges) separated by commas. Append T (abso‐
79 lute calendar time), t (relative time in chosen TIME_UNIT since
80 TIME_EPOCH), x (longitude), y (latitude), or f (floating point)
81 to each column or column range item. Shorthand -f[i|o]g means
82 -f[i|o]0x,1y (geographic coordinates).
83
84 -m Multiple segment file(s). Segments are separated by a special
85 record. For ASCII files the first character must be flag
86 [Default is '>']. For binary files all fields must be NaN and
87 -b must set the number of output columns explicitly. By default
88 the -m setting applies to both input and output. Use -mi and
89 -mo to give separate settings to input and output.
90
92 The ASCII output formats of numerical data are controlled by parameters
93 in your .gmtdefaults4 file. Longitude and latitude are formatted
94 according to OUTPUT_DEGREE_FORMAT, whereas other values are formatted
95 according to D_FORMAT. Be aware that the format in effect can lead to
96 loss of precision in the output, which can lead to various problems
97 downstream. If you find the output is not written with enough preci‐
98 sion, consider switching to binary output (-bo if available) or specify
99 more decimals using the D_FORMAT setting.
100
102 To find the extreme values in the file ship_gravity.xygd:
103
104 minmax ship_gravity.xygd
105
106 Output should look like
107
108 ship_gravity.xygd: N = 6992 <326.125/334.684> <-28.0711/-8.6837>
109 <-47.7/177.6> <0.6/3544.9>
110
111 To find the extreme values in the file track.xy to the nearest 5 units
112 and use this region to draw a line using psxy, run
113
114 psxy `minmax -I5 track.xy` track.xy -Jx1 -B5 -P > track.ps
115
116 To find the min and max values for each of the first 4 columns, but
117 rounded to integers, use
118
119 minmax junkfile -C -I1/1/1/1
120
122 The -I option does not yet work properly with time series data (e.g.,
123 -f0T). Thus, such variable intervals as months and years are not cal‐
124 culated. Instead, specify your interval in the same units as the cur‐
125 rent setting of TIME_UNIT.
126
128 GMT(1)
129
130
131
132GMT 4.5.6 10 Mar 2011 MINMAX(1)