1BLOCKMODE(1)                 Generic Mapping Tools                BLOCKMODE(1)
2
3
4

NAME

6       blockmode - filter to block average (x,y,z) data by mode estimation.
7

SYNOPSIS

9       blockmode   [   xyz[w]file(s)   ]   -Ixinc[unit][=|+][/yinc[unit][=|+]]
10       -Rxmin/xmax/ymin/ymax[r] [ -C ] [ -E ] [ -F ] [ -H[i][nrec] ] [ -Q ]  [
11       -V  ]  [  -W[io] ] [ -:[i|o] ] [ -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [
12       -f[i|o]colinfo ]
13

DESCRIPTION

15       blockmode 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 mode estimates of position and value  for
18       every  non-empty  block in a grid region defined by the -R and -I argu‐
19       ments.  Either blockmean, blockmedian, or blockmode should be used as a
20       pre-processor  before  running  surface  to  avoid aliasing short wave‐
21       lengths.  These routines are also generally useful  for  decimating  or
22       averaging  (x,y,z)  data.   You  can modify the precision of the output
23       format by editing the D_FORMAT parameter in your .gmtdefaults4 file, or
24       you may choose binary input and/or output using single or double preci‐
25       sion storage.
26
27       xyz[w]file(s)
28              3 [or 4] column  ASCII  file(s)  [or  binary,  see  -b]  holding
29              (x,y,z[,w])  data  values.   [w]  is  an optional weight for the
30              data.  If no file is specified, blockmode will read  from  stan‐
31              dard input.
32
33       -I     x_inc  [and  optionally  y_inc] is the grid spacing. Optionally,
34              append a suffix modifier.  Geographical  (degrees)  coordinates:
35              Append  m  to indicate arc minutes or c to indicate arc seconds.
36              If one of the units e, k, i,  or  n  is  appended  instead,  the
37              increment  is assumed to be given in meter, km, miles, or nauti‐
38              cal miles, respectively, and will be converted to the equivalent
39              degrees longitude at the middle latitude of the region (the con‐
40              version depends on ELLIPSOID).  If /y_inc is given but set to  0
41              it  will be reset equal to x_inc; otherwise it will be converted
42              to degrees latitude.  All coordinates: If = is appended then the
43              corresponding max x (east) or y (north) may be slightly adjusted
44              to fit exactly the given increment [by default the increment may
45              be adjusted slightly to fit the given domain].  Finally, instead
46              of giving an increment you  may  specify  the  number  of  nodes
47              desired  by  appending  +  to the supplied integer argument; the
48              increment is then recalculated from the number of nodes and  the
49              domain.   The  resulting  increment value depends on whether you
50              have selected a gridline-registered  or  pixel-registered  grid;
51              see  Appendix  B  for  details.  Note: if -Rgrdfile is used then
52              grid spacing has already been initialized; use  -I  to  override
53              the values.
54
55       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
56              geographic regions,  these  limits  correspond  to  west,  east,
57              south,  and north and you may specify them in decimal degrees or
58              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
59              and  upper  right  map coordinates are given instead of w/e/s/n.
60              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
61              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
62              tude).  Alternatively, specify the name of an existing grid file
63              and the -R settings (and grid spacing, if applicable) are copied
64              from the grid.  For calendar time  coordinates  you  may  either
65              give  (a) relative time (relative to the selected TIME_EPOCH and
66              in the selected TIME_UNIT; append t to -JX|x), or  (b)  absolute
67              time  of  the form [date]T[clock] (append T to -JX|x).  At least
68              one of date and clock must be present; the T is always required.
69              The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
70              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
71              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
72              iters and their type and positions must be exactly as  indicated
73              (however,  input,  output and plot formats are customizable; see
74              gmtdefaults).
75

OPTIONS

77       -C     Use the center of the block as the output location [Default uses
78              the modal xy location (but see -Q)].  -C overrides -Q.
79
80       -E     Provide  Extended  report  which includes s (the L1 scale of the
81              mode), l, the lowest value, and  h,  the  high  value  for  each
82              block.  Output  order  becomes x,y,z,s,l,h[,w]. [Default outputs
83              x,y,z[,w].  See -W for w output.
84
85       -F     Force pixel node registration  [Default  is  gridline  registra‐
86              tion].  (Node registrations are defined in GMT Cookbook Appendix
87              B on grid file formats.)  Each block  is  the  locus  of  points
88              nearest   the   grid   value   location.    For   example,  with
89              -R10/15/10/15 and and -I1:  with the -F option 10 <= (x,y) <  11
90              is one of 25 blocks; without it 9.5 <= (x,y) < 10.5 is one of 36
91              blocks.
92
93       -H     Input file(s) has header record(s).  If used, the default number
94              of  header records is N_HEADER_RECS.  Use -Hi if only input data
95              should have  header  records  [Default  will  write  out  header
96              records  if  the  input  data  have them]. Blank lines and lines
97              starting with # are always skipped.  Not used with binary data.
98
99       -Q     (Quicker) Finds mode z and mean (x, y) [Default  finds  mode  x,
100              mode y, mode z].
101
102       -V     Selects verbose mode, which will send progress reports to stderr
103              [Default runs "silently"].
104
105       -W     Weighted modifier[s].  Unweighted input and output has 3 columns
106              x,y,z;  Weighted i/o has 4 columns x,y,z,w.  Weights can be used
107              in input to construct weighted mean values  in  blocks.   Weight
108              sums can be reported in output for later combining several runs,
109              etc.  Use -W for weighted i/o, -Wi for weighted  inputonly,  -Wo
110              for weighted output only.  [Default uses unweighted i/o].
111
112       -:     Toggles  between  (longitude,latitude)  and (latitude,longitude)
113              input and/or output.  [Default is (longitude,latitude)].  Append
114              i  to  select  input  only or o to select output only.  [Default
115              affects both].
116
117       -bi    Selects binary input.  Append s for single precision [Default is
118              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
119              Optionally, append ncol, the number of columns  in  your  binary
120              input  file if it exceeds the columns needed by the program.  Or
121              append c  if  the  input  file  is  netCDF.  Optionally,  append
122              var1/var2/...  to specify the variables to be read.  [Default is
123              3 (or 4 if -Wi is set)].
124
125       -bo    Selects binary output.  Append s for single  precision  [Default
126              is  d  (double)].   Uppercase  S  or D will force byte-swapping.
127              Optionally, append ncol, the number of desired columns  in  your
128              binary  output  file.   [Default  is 3 (or 4 if -Wo is set)]. -E
129              adds 3 additional columns.
130
131       -f     Special formatting of input and/or output columns (time or  geo‐
132              graphical  data).   Specify  i  or  o to make this apply only to
133              input or output [Default applies to both].   Give  one  or  more
134              columns (or column ranges) separated by commas.  Append T (abso‐
135              lute calendar time), t (relative time in chosen TIME_UNIT  since
136              TIME_EPOCH),  x (longitude), y (latitude), or f (floating point)
137              to each column or column range item.  Shorthand  -f[i|o]g  means
138              -f[i|o]0x,1y (geographic coordinates).
139

ASCII FORMAT PRECISION

141       The ASCII output formats of numerical data are controlled by parameters
142       in your .gmtdefaults4  file.   Longitude  and  latitude  are  formatted
143       according  to  OUTPUT_DEGREE_FORMAT, whereas other values are formatted
144       according to D_FORMAT.  Be aware that the format in effect can lead  to
145       loss  of  precision  in  the output, which can lead to various problems
146       downstream.  If you find the output is not written with  enough  preci‐
147       sion, consider switching to binary output (-bo if available) or specify
148       more decimals using the D_FORMAT setting.
149

EXAMPLES

151       To find 5 by 5 minute block mode estimates from  the  double  precision
152       binary data in hawaii_b.xyg and output an ASCII table, run:
153
154       blockmode hawaii_b.xyg -R198/208/18/25 -I5m -bi3 > hawaii_5x5.xyg
155

SEE ALSO

157       blockmean(1),  blockmedian(1), GMT(1), gmtdefaults(1), nearneighbor(1),
158       surface(1), triangulate(1)
159
160
161
162GMT 4.5.6                         10 Mar 2011                     BLOCKMODE(1)
Impressum