1BLOCKMEAN(1) Generic Mapping Tools BLOCKMEAN(1)
2
3
4
6 blockmean - filter to block average (x,y,z) data by L2 norm
7
9 blockmean [ xyz[w]file(s) ] -Ixinc[unit][=|+][/yinc[unit][=|+]]
10 -Rxmin/xmax/ymin/ymax[r] [ -C ] [ -D ] [ -E ] [ -F ] [ -H[i][nrec] ] [
11 -S[w|z] ] [ -V ] [ -W[io] ] [ -:[i|o] ] [
12 -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ]
13
15 blockmean reads arbitrarily located (x,y,z) triples [or optionally
16 weighted quadruples (x,y,z,w)] from standard input [or xyz[w]file(s)]
17 and writes to standard output a mean position and value for every non-
18 empty block in a grid region defined by the -R and -I arguments. Either
19 blockmean, blockmedian, or blockmode should be used as a pre-processor
20 before running surface to avoid aliasing short wavelengths. These rou‐
21 tines are also generally useful for decimating or averaging (x,y,z)
22 data. You can modify the precision of the output format by editing the
23 D_FORMAT parameter in your .gmtdefaults4 file, or you may choose binary
24 input and/or output using single or double precision storage.
25
26 xyz[w]file(s)
27 3 [or 4] column ASCII file(s) [or binary, see -b] holding
28 (x,y,z[,w]) data values. [w] is an optional weight for the
29 data. If no file is specified, blockmean will read from stan‐
30 dard input.
31
32 -I 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 c to indicate arc seconds.
35 If one of the units e, k, i, or n is appended instead, the
36 increment is assumed to be given in meter, km, miles, or nauti‐
37 cal miles, respectively, and will be converted to the equivalent
38 degrees longitude at the middle latitude of the region (the con‐
39 version depends on ELLIPSOID). If /y_inc is given but set to 0
40 it will be reset equal to x_inc; otherwise it will be converted
41 to degrees latitude. All coordinates: If = is appended then the
42 corresponding max x (east) or y (north) may be slightly adjusted
43 to fit exactly the given increment [by default the increment may
44 be adjusted slightly to fit the given domain]. Finally, instead
45 of giving an increment you may specify the number of nodes
46 desired by appending + to the supplied integer argument; the
47 increment is then recalculated from the number of nodes and the
48 domain. The resulting increment value depends on whether you
49 have selected a gridline-registered or pixel-registered grid;
50 see Appendix B for details.
51
52 -R xmin, xmax, ymin, and ymax specify the Region of interest. For
53 geographic regions, these limits correspond to west, east,
54 south, and north and you may specify them in decimal degrees or
55 in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left
56 and upper right map coordinates are given instead of w/e/s/n.
57 The two shorthands -Rg and -Rd stand for global domain (0/360
58 and -180/+180 in longitude respectively, with -90/+90 in lati‐
59 tude). For calendar time coordinates you may either give (a)
60 relative time (relative to the selected TIME_EPOCH and in the
61 selected TIME_UNIT; append t to -JX|x), or (b) absolute time of
62 the form [date]T[clock] (append T to -JX|x). At least one of
63 date and clock must be present; the T is always required. The
64 date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
65 calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
66 string must be of the form hh:mm:ss[.xxx]. The use of delim‐
67 iters and their type and positions must be exactly as indicated
68 (however, input, output and plot formats are customizable; see
69 gmtdefaults).
70
72 -C Use the center of the block as the output location [Default uses
73 the mean location].
74
75 -E Provide Extended report which includes s (the standard deviation
76 of the mean), l, the lowest value, and h, the high value for
77 each block. Output order becomes x,y,z,s,l,h[,w]. [Default out‐
78 puts x,y,z[,w]. See -W for w output.
79
80 -F Force pixel node registration [Default is gridline registra‐
81 tion]. (Node registrations are defined in GMT Cookbook Appendix
82 B on grid file formats.) Each block is the locus of points
83 nearest the grid value location. For example, with
84 -R10/15/10/15 and and -I1: with the -F option 10 <= (x,y) < 11
85 is one of 25 blocks; without it 9.5 <= (x,y) < 10.5 is one of 36
86 blocks.
87
88 -H Input file(s) has Header record(s). Number of header records
89 can be changed by editing your .gmtdefaults4 file. If used, GMT
90 default is 1 header record. Use -Hi if only input data should
91 have header records [Default will write out header records if
92 the input data have them]. Blank lines and lines starting with #
93 are always skipped. Not used with binary data.
94
95 -S Use -Sz to report the sum of all z-values inside a block, or -Sw
96 to report the sum of weights [Default reports mean value]. If
97 -Sw is selected and no weights are supplied (i.e., no -W given),
98 then the weight sum will equal the number of points inside each
99 block.
100
101 -V Selects verbose mode, which will send progress reports to stderr
102 [Default runs "silently"].
103
104 -W Weighted modifier[s]. Unweighted input and output has 3 columns
105 x,y,z; Weighted i/o has 4 columns x,y,z,w. Weights can be used
106 in input to construct weighted mean values in blocks. Weight
107 sums can be reported in output for later combining several runs,
108 etc. Use -W for weighted i/o, -Wi for weighted inputonly, -Wo
109 for weighted output only. [Default uses unweighted i/o].
110
111 -: Toggles between (longitude,latitude) and (latitude,longitude)
112 input and/or output. [Default is (longitude,latitude)]. Append
113 i to select input only or o to select output only. [Default
114 affects both].
115
116 -bi Selects binary input. Append s for single precision [Default is
117 d (double)]. Uppercase S or D will force byte-swapping.
118 Optionally, append ncol, the number of columns in your binary
119 input file if it exceeds the columns needed by the program. Or
120 append c if the input file is netCDF. Optionally, append
121 var1/var2/... to specify the variables to be read. [Default is
122 3 (or 4 if -Wi is set)].
123
124 -bo Selects binary output. Append s for single precision [Default
125 is d (double)]. Uppercase S or D will force byte-swapping.
126 Optionally, append ncol, the number of desired columns in your
127 binary output file. [Default is 3 (or 4 if -Wo is set)]. -E
128 adds 3 additional columns.
129
130 -f Special formatting of input and/or output columns (time or geo‐
131 graphical data). Specify i or o to make this apply only to
132 input or output [Default applies to both]. Give one or more
133 columns (or column ranges) separated by commas. Append T (abso‐
134 lute calendar time), t (relative time in chosen TIME_UNIT since
135 TIME_EPOCH), x (longitude), y (latitude), or f (floating point)
136 to each column or column range item. Shorthand -f[i|o]g means
137 -f[i|o]0x,1y (geographic coordinates).
138
140 The ASCII output formats of numerical data are controlled by parameters
141 in your .gmtdefaults4 file. Longitude and latitude are formatted
142 according to OUTPUT_DEGREE_FORMAT, whereas other values are formatted
143 according to D_FORMAT. Be aware that the format in effect can lead to
144 loss of precision in the output, which can lead to various problems
145 downstream. If you find the output is not written with enough preci‐
146 sion, consider switching to binary output (-bo if available) or specify
147 more decimals using the D_FORMAT setting.
148
150 To find 5 by 5 minute block mean values from the ASCII data in
151 hawaii.xyg, run
152
153 blockmean hawaii.xyg -R198/208/18/25 -I5m > hawaii_5x5.xyg
154
156 blockmedian(1), blockmode(1), gmtdefaults(1), GMT(1), nearneighbor(1),
157 surface(1), triangulate(1)
158
159
160
161GMT 4.3.1 15 May 2008 BLOCKMEAN(1)