blockmedian - Block average (x,y,z) data tables by L1 norm
blockmedian [ table ] -Iincrement -Rregion [ -C ] [ -E[b] ] [ -Er|s[-] ] [ -Q ] [ -Tquantile ] [ -V[level] ] [ -W[i|o] ] [ -b<binary> ] [ -d<nodata> ] [ -f<flags> ] [ -h<headers> ] [ -i<flags> ] [ -o<flags> ] [ -r ] [ -:[i|o] ]
Note: No space is allowed between the option flag and the associated arguments.
blockmedian reads arbitrarily located (x,y,z) triples [or optionally weighted quadruples (x,y,z,w)] from standard input [or table] and writes to standard output a median position and value for every non-empty block in a grid region defined by the -R and -I arguments. Either blockmean, blockmedian, or blockmode should be used as a pre-processor before running surface to avoid aliasing short wavelengths. These routines are also generally useful for decimating or averaging (x,y,z) data. You can modify the precision of the output format by editing the FORMAT_FLOAT_OUT parameter in your gmt.conf file, or you may choose binary input and/or output to avoid loss of precision.
The ASCII output formats of numerical data are controlled by parameters in your gmt.conf file. Longitude and latitude are formatted according to FORMAT_GEO_OUT, whereas other values are formatted according to FORMAT_FLOAT_OUT. 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 FORMAT_FLOAT_OUT setting.
To find 5 by 5 minute block medians from the double precision binary data in hawaii_b.xyg and output an ASCII table, run
gmt blockmedian hawaii_b.xyg -R198/208/18/25 -I5m -bi3d > hawaii_5x5.xyg
To compute the shape of a data distribution per bin via a box-and-whisker diagram we need the 0%, 25%, 50%, 75%, and 100% quantiles. To do so on a global 5 by 5 degree basis from the ASCII table depths.xyz and send output to an ASCII table, run
gmt blockmedian depths.xyz -Rg -I5 -Eb -r > depths_5x5.txt
blockmean, blockmode, gmt, gmt.conf, greenspline, nearneighbor, surface, sphtriangulate, triangulate