Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

blockmean.rst 6.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
  1. .. index:: ! blockmean
  2. .. include:: module_core_purpose.rst_
  3. *********
  4. blockmean
  5. *********
  6. |blockmean_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt blockmean** [ *table* ]
  11. |SYN_OPT-I|
  12. |SYN_OPT-R|
  13. [ |-A|\ *fields* ]
  14. [ |-C| ]
  15. [ |-E|\ [**+p**\|\ **P**] ]
  16. [ |-G|\ [*grdfile*] ]
  17. [ |-S|\ [**m**\|\ **n**\|\ **s**\|\ **w**] ]
  18. [ |SYN_OPT-V| ]
  19. [ |-W|\ [**i**\|\ **o**][**+s**\|\ **w**] ]
  20. [ |SYN_OPT-a| ]
  21. [ |SYN_OPT-b| ]
  22. [ |SYN_OPT-d| ]
  23. [ |SYN_OPT-e| ]
  24. [ |SYN_OPT-f| ]
  25. [ |SYN_OPT-h| ]
  26. [ |SYN_OPT-i| ]
  27. [ |SYN_OPT-o| ]
  28. [ |SYN_OPT-q| ]
  29. [ |SYN_OPT-r| ]
  30. [ |SYN_OPT-w| ]
  31. [ |SYN_OPT-:| ]
  32. [ |SYN_OPT--| ]
  33. |No-spaces|
  34. Description
  35. -----------
  36. **blockmean** reads arbitrarily located (*x*,\ *y*,\ *z*) triples [or
  37. optionally weighted quadruples (*x*,\ *y*,\ *z*,\ *w*)] from standard
  38. input [or *table*] and writes to standard output a mean position and
  39. value for every non-empty block in a grid region defined by the **-R**
  40. and **-I** arguments. See **-G** for writing gridded output directly.
  41. Either **blockmean**, :doc:`blockmedian`, or
  42. :doc:`blockmode` should be used as a pre-processor before running
  43. :doc:`surface` to avoid aliasing short wavelengths. These routines are also
  44. generally useful for decimating or averaging (*x*,\ *y*,\ *z*) data. You
  45. can modify the precision of the output format by editing the
  46. :term:`FORMAT_FLOAT_OUT` parameter in your :doc:`gmt.conf` file, or you may
  47. choose binary input and/or output to avoid loss of precision.
  48. Required Arguments
  49. ------------------
  50. *table*
  51. 3 (or 4, see **-W**) column ASCII data table file(s) (or binary, see
  52. **-bi**) holding (*x*,\ *y*,\ *z*\ [,\ *w*])
  53. data values, where [*w*] is an optional weight for the data. If no file
  54. is specified, **blockmean** will read from standard input.
  55. .. _-I:
  56. .. include:: explain_-I.rst_
  57. .. |Add_-R| replace:: |Add_-R_links|
  58. .. include:: explain_-R.rst_
  59. :start-after: **Syntax**
  60. :end-before: **Description**
  61. Optional Arguments
  62. ------------------
  63. .. _-A:
  64. **-A**\ *fields*
  65. Select which fields to write to individual grids. Requires **-G**.
  66. Append the codes for available fields: **z** (the mean
  67. data z, but see **-S**), **s** (standard deviation), **l** (lowest
  68. value), **h** (highest value) and **w** (the output weight; requires **-W**).
  69. Note **s**\|\ **l**\|\ **h** requires **-E** [Default is just **z**].
  70. .. _-C:
  71. **-C**
  72. Use the center of the block as the output location [Default uses the mean location].
  73. .. _-E:
  74. **-E**\ [**+p**\|\ **P**]
  75. Provide Extended report which includes **s** (the standard deviation
  76. about the mean), **l**, the lowest value, and **h**, the high value
  77. for each block. Output order becomes
  78. *x*,\ *y*,\ *z*,\ *s*,\ *l*,\ *h*\ [,\ *w*]. Default outputs
  79. *x*,\ *y*,\ *z*\ [,\ *w*]. See **-W** for enabling *w* output.
  80. If **-E+p**\|\ **P** is used then input data uncertainties are expected and *s*
  81. becomes the propagated error of the weighted (**+p**) or simple (**+P**) *z* mean.
  82. .. _-G:
  83. **-G**\ *grdfile*
  84. Write one or more fields directly to grids; no table data are written to
  85. standard output. If more than one fields are specified via **-A** then
  86. *grdfile* must contain the format flag %s so that we can embed the field
  87. code in the file names.
  88. .. _-S:
  89. **-S**\ [**m**\|\ **n**\|\ **s**\|\ **w**]
  90. Use **-Sn** to report the number of input points inside each block,
  91. **-Ss** to report the sum of all *z*-values inside a block, **-Sw**
  92. to report the sum of weights [Default or **-Sm** reports mean value].
  93. .. |Add_-V| replace:: |Add_-V_links|
  94. .. include:: explain_-V.rst_
  95. :start-after: **Syntax**
  96. :end-before: **Description**
  97. .. _-W:
  98. **-W**\ [**i**\|\ **o**][**+s**\|\ **w**]
  99. Weighted modifier[s]. Unweighted input and output have 3 columns
  100. *x*,\ *y*,\ *z*; Weighted i/o has 4 columns *x*,\ *y*,\ *z*,\ *w*.
  101. Weights can be used in input to construct weighted mean values for
  102. each block. Weight sums can be reported in output for later combining
  103. several runs, etc. Use **-W** for weighted i/o, **-Wi** for weighted
  104. input only, and **-Wo** for weighted output only. [Default uses
  105. unweighted i/o]. If your weights are actually uncertainties (one sigma)
  106. then append **+s** and we compute weight = 1/sigma. Otherwise (or via **+w**
  107. we use the weights directly).
  108. .. include:: explain_-aspatial.rst_
  109. .. |Add_-bi| replace:: [Default is 3 (or 4 if **-Wi** is set)].
  110. .. include:: explain_-bi.rst_
  111. .. |Add_-bo| replace:: [Default is 3 (or 4 if **-Wo** is set)]. **-E** adds 3 additional columns.
  112. The **-Sn** option will work with only 2 input columns (x and y).
  113. .. include:: explain_-bo.rst_
  114. .. |Add_-d| unicode:: 0x20 .. just an invisible code
  115. .. include:: explain_-d.rst_
  116. .. |Add_-e| unicode:: 0x20 .. just an invisible code
  117. .. include:: explain_-e.rst_
  118. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  119. .. include:: explain_-f.rst_
  120. .. |Add_-h| unicode:: 0x20 .. just an invisible code
  121. .. include:: explain_-h.rst_
  122. .. include:: explain_-icols.rst_
  123. .. include:: explain_-ocols.rst_
  124. .. include:: explain_-q.rst_
  125. .. |Add_nodereg| replace::
  126. Each block is the locus of points nearest the grid value location. Consider an example with
  127. **-R**\ 10/15/10/15 and **-I**\ 1: With **-r** or **-rp**, 10 <=
  128. (*x*,\ *y*) < 11 is one of 25 blocks; otherwise 9.5 <= (*x*,\ *y*)
  129. < 10.5 is one of 36 blocks.
  130. .. include:: explain_nodereg.rst_
  131. .. include:: explain_-w.rst_
  132. .. include:: explain_colon.rst_
  133. .. include:: explain_help.rst_
  134. .. include:: explain_precision.rst_
  135. Examples
  136. --------
  137. To find 5 by 5 minute block mean values from the ASCII data in ship_15.txt, run
  138. ::
  139. gmt blockmean @ship_15.txt -R245/255/20/30 -I5m > ship_5x5.txt
  140. To determine how many values were found in each 5x5 minute bin, try
  141. ::
  142. gmt blockmean @ship_15.txt -R245/255/20/30 -I5m -Sn > ship_5x5_count.txt
  143. To determine the mean and standard deviation per 10 minute bin and save these to two separate grids
  144. called field_z.nc and field_s.nc, run
  145. ::
  146. gmt blockmean @ship_15.txt -I10m -R-115/-105/20/30 -E -Gfield_%s.nc -Azs
  147. See Also
  148. --------
  149. :doc:`blockmedian`,
  150. :doc:`blockmode`,
  151. :doc:`gmt`,
  152. :doc:`gmt.conf`,
  153. :doc:`greenspline`,
  154. :doc:`nearneighbor`,
  155. :doc:`sphtriangulate`,
  156. :doc:`surface`,
  157. :doc:`triangulate`
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...