1BLOCKMEDIAN(1) GMT BLOCKMEDIAN(1)
2
3
4
6 blockmedian - Block average (x, y, z) data tables by L1 norm
7
9 blockmedian [ table ]
10 -Iincrement
11 -Rregion [ -C ] [ -E[b] ] [ -Er|s[-] ] [ -Q ] [ -Tquantile ] [
12 -V[level] ] [ -W[i|o][+s] ] [ -bbinary ] [ -dnodata ] [ -eregexp ] [
13 -fflags ] [ -hheaders ] [ -iflags ] [ -oflags ] [ -r ] [ -:[i|o] ]
14
15 Note: No space is allowed between the option flag and the associated
16 arguments.
17
19 blockmedian reads arbitrarily located (x,y,z) triples [or optionally
20 weighted quadruples (x,y,z,w)] from standard input [or table] and
21 writes to standard output a median position and value for every
22 non-empty block in a grid region defined by the -R and -I arguments.
23 Either blockmean, blockmedian, or blockmode should be used as a
24 pre-processor before running surface to avoid aliasing short wave‐
25 lengths. These routines are also generally useful for decimating or
26 averaging (x,y,z) data. You can modify the precision of the output for‐
27 mat by editing the FORMAT_FLOAT_OUT parameter in your gmt.conf file, or
28 you may choose binary input and/or output to avoid loss of precision.
29
31 -Ixinc[unit][+e|n][/yinc[unit][+e|n]]
32 x_inc [and optionally y_inc] is the grid spacing. Optionally,
33 append a suffix modifier. Geographical (degrees) coordinates:
34 Append m to indicate arc minutes or s to indicate arc seconds.
35 If one of the units e, f, k, M, n or u is appended instead, the
36 increment is assumed to be given in meter, foot, km, Mile, nau‐
37 tical mile or US survey foot, respectively, and will be con‐
38 verted to the equivalent degrees longitude at the middle lati‐
39 tude of the region (the conversion depends on PROJ_ELLIPSOID).
40 If y_inc is given but set to 0 it will be reset equal to x_inc;
41 otherwise it will be converted to degrees latitude. All coordi‐
42 nates: If +e is appended then the corresponding max x (east) or
43 y (north) may be slightly adjusted to fit exactly the given
44 increment [by default the increment may be adjusted slightly to
45 fit the given domain]. Finally, instead of giving an increment
46 you may specify the number of nodes desired by appending +n to
47 the supplied integer argument; the increment is then recalcu‐
48 lated from the number of nodes and the domain. The resulting
49 increment value depends on whether you have selected a grid‐
50 line-registered or pixel-registered grid; see App-file-formats
51 for details. Note: if -Rgrdfile is used then the grid spacing
52 has already been initialized; use -I to override the values.
53
54 -Rxmin/xmax/ymin/ymax[+r][+uunit] (more ...)
55 Specify the region of interest.
56
58 table 3 [or 4, see -W] column ASCII data table] column ASCII file(s)
59 [or binary, see -bi] holding (x,y,z[,w]) data values. [w] is an
60 optional weight for the data. If no file is specified, blockme‐
61 dian will read from standard input.
62
63 -C Use the center of the block as the output location [Default uses
64 the median x and median y as location (but see -Q)].
65
66 -E[b] Provide Extended report which includes s (the L1 scale of the
67 median), l, the lowest value, and h, the high value for each
68 block. Output order becomes x,y,z,s,l,h[,w]. [Default outputs
69 x,y,z[,w]. For box-and-whisker calculation, use -Eb which will
70 output x,y,z,l,q25,q75,h[,w], where q25 and q75 are the 25% and
71 75% quantiles, respectively. See -W for w output.
72
73 -Er|s[-]
74 Provide source id s or record number r output, i.e., append the
75 source id or record number associated with the median value. If
76 tied then report the record number of the higher of the two val‐
77 ues; append - to instead report the record number of the lower
78 value. Note that both -E[b] and -Er[-] may be specified. For
79 -Es we expect input records of the form x,y,z[,w],sid, where sid
80 is an unsigned integer source id.
81
82 -Q (Quicker) Finds median z and (x,y) at that the median z [Default
83 finds median x, median y independent of z]. Also see -C.
84
85 -Tquantile
86 Sets the quantile of the distribution to be returned [Default is
87 0.5 which returns the median z]. Here, 0 < quantile < 1.
88
89 -V[level] (more ...)
90 Select verbosity level [c].
91
92 -W[i|o][+s]
93 Weighted modifier[s]. Unweighted input and output have 3 columns
94 x,y,z; Weighted i/o has 4 columns x,y,z,w. Weights can be used
95 in input to construct weighted median values for each block.
96 Weight sums can be reported in output for later combining sev‐
97 eral runs, etc. Use -W for weighted i/o, -Wi for weighted input
98 only, and -Wo for weighted output only. [Default uses unweighted
99 i/o]. If your weights are actually uncertainties (one sigma)
100 then append +s and we compute weight = 1/sigma.
101
102 -bi[ncols][t] (more ...)
103 Select native binary input. [Default is 3 (or 4 if -Wi is set)].
104
105 -bo[ncols][type] (more ...)
106 Select native binary output. [Default is 3 (or 4 if -Wo is
107 set)]. -E adds 3 additional columns.
108
109 -d[i|o]nodata (more ...)
110 Replace input columns that equal nodata with NaN and do the
111 reverse on output.
112
113 -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
114 Only accept data records that match the given pattern.
115
116 -f[i|o]colinfo (more ...)
117 Specify data types of input and/or output columns.
118
119 -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
120 Skip or produce header record(s).
121
122 -icols[+l][+sscale][+ooffset][,...] (more ...)
123 Select input columns and transformations (0 is first column).
124
125 -ocols[,...] (more ...)
126 Select output columns (0 is first column).
127
128 -r (more ...)
129 Set pixel node registration [gridline]. Each block is the locus
130 of points nearest the grid value location. Consider an example
131 with -R10/15/10/15 and -I1: With the -r option, 10 <= (x,y) < 11
132 is one of 25 blocks; without it 9.5 <= (x,y) < 10.5 is one of 36
133 blocks.
134
135 -:[i|o] (more ...)
136 Swap 1st and 2nd column on input and/or output.
137
138 -^ or just -
139 Print a short message about the syntax of the command, then
140 exits (NOTE: on Windows just use -).
141
142 -+ or just +
143 Print an extensive usage (help) message, including the explana‐
144 tion of any module-specific option (but not the GMT common
145 options), then exits.
146
147 -? or no arguments
148 Print a complete usage (help) message, including the explanation
149 of all options, then exits.
150
152 The ASCII output formats of numerical data are controlled by parameters
153 in your gmt.conf file. Longitude and latitude are formatted according
154 to FORMAT_GEO_OUT, absolute time is under the control of FOR‐
155 MAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point val‐
156 ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
157 mat in effect can lead to loss of precision in ASCII output, which can
158 lead to various problems downstream. If you find the output is not
159 written with enough precision, consider switching to binary output (-bo
160 if available) or specify more decimals using the FORMAT_FLOAT_OUT set‐
161 ting.
162
164 To find 5 by 5 minute block medians from the double precision binary
165 data in hawaii_b.xyg and output an ASCII table, run
166
167 gmt blockmedian hawaii_b.xyg -R198/208/18/25 -I5m -bi3d > hawaii_5x5.xyg
168
169 To compute the shape of a data distribution per bin via a
170 box-and-whisker diagram we need the 0%, 25%, 50%, 75%, and 100% quan‐
171 tiles. To do so on a global 5 by 5 degree basis from the ASCII table
172 depths.xyz and send output to an ASCII table, run
173
174 gmt blockmedian depths.xyz -Rg -I5 -Eb -r > depths_5x5.txt
175
177 blockmean, blockmode, gmt, gmt.conf, greenspline, nearneighbor, sur‐
178 face, sphtriangulate, triangulate
179
181 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
182
183
184
185
1865.4.5 Feb 24, 2019 BLOCKMEDIAN(1)