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

grdvolume.rst 6.5 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
  1. .. index:: ! grdvolume
  2. .. include:: module_core_purpose.rst_
  3. *********
  4. grdvolume
  5. *********
  6. |grdvolume_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdvolume** *grdfile* [ |-C|\ *cval* or |-C|\ *low/high/delta* or |-C|\ **r**\ *low/high* or |-C|\ **r**\ *cval*]
  11. [ |-D| ]
  12. [ |-L|\ *base* ]
  13. [ |SYN_OPT-R| ]
  14. [ |-S|\ [*unit*] ]
  15. [ |-T|\ [**c**\|\ **h**] ]
  16. [ |SYN_OPT-V| ]
  17. [ |-Z|\ *fact*\ [/*shift*] ]
  18. [ |SYN_OPT-f| ]
  19. [ |SYN_OPT-o| ]
  20. [ |SYN_OPT--| ]
  21. |No-spaces|
  22. Description
  23. -----------
  24. **grdvolume** reads a 2-D grid file and calculates the volume contained below the surface and above the plane specified
  25. by the given contour (or zero if not given) and reports the contour, area, volume, and maximum mean height (volume/area).
  26. Alternatively, specify a range of contours to be tried and **grdvolume** will determine the volume and area inside
  27. the contour for all contour values. Using **-T**, the contour that produced the maximum mean height (or maximum
  28. curvature of heights vs contour value) is reported as well. This feature may be used with :doc:`grdfilter`
  29. in designing an Optimal Robust Separator [*Wessel*, 1998].
  30. Required Arguments
  31. ------------------
  32. *grdfile*
  33. The name of the input 2-D binary grid file. (See GRID FILE FORMAT below.)
  34. Optional Arguments
  35. ------------------
  36. .. _-C:
  37. **-C**\ *cval* or **-C**\ *low/high/delta* or **-Cr**\ *low/high* or **-Cr**\ *cval*
  38. find area, volume and mean height (volume/area) inside and above the *cval* contour. Alternatively, search using
  39. all contours from *low* to *high* in steps of *delta*. [Default returns area, volume and mean height
  40. of the entire grid]. The area is measured in the plane of the contour. The **Cr** form on the other
  41. hand computes the volume below the grid surface and above the planes defined by *low* and *high*,
  42. or below *cval* and grid's minimum. Note that this is an *outside* volume whilst the other forms
  43. compute an *inside* (below the surface) area volume. Use this form to compute for example the volume
  44. of water between two contours. **Note**: If no **-C** is given then there is no contour and we return
  45. the entire grid area, volume and the mean height; *cval* will be reported as 0 but we are not tracing
  46. a zero-contour (which we do if **-C**\ 0 is given).
  47. .. _-D:
  48. **-D**
  49. Requires **-C**\ *low/high/delta* and will compute the area and volume of each horizontal *slice* as defined by the
  50. contours. The reported contour and area values refer to the base of the slice, and the *height* is set to *delta*
  51. (since that is the thickness of all slices).
  52. .. _-L:
  53. **-L**\ *base*
  54. Also add in the volume from the level of the contour down to *base* [Default base is contour].
  55. .. _-S:
  56. **-S**\ [*unit*]
  57. For geographical grids, append a unit from
  58. **e**\|\ **f**\|\ **k**\|\ **M**\|\ **n**\|\ **u**
  59. [Default is meter (**e**)].
  60. .. _-T:
  61. **-T**\ [**c**\|\ **h**]
  62. Determine the single contour that maximized the average height (=
  63. volume/area). Select **-Tc** to use the maximum curvature of heights
  64. versus contour value rather than the contour with the maximum height
  65. to pick the best contour value (requires **-C**).
  66. .. _-R:
  67. .. |Add_-R| unicode:: 0x20 .. just an invisible code
  68. .. include:: explain_-R.rst_
  69. .. _-V:
  70. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  71. .. include:: explain_-V.rst_
  72. .. _-Z:
  73. **-Z**\ *fact*\ [/*shift*]
  74. Optionally subtract *shift* before scaling data by *fact*. [Default
  75. is no scaling]. (Numbers in **-C**, **-L** refer to values after
  76. this scaling has occurred).
  77. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  78. .. include:: explain_-f.rst_
  79. .. include:: explain_-ocols.rst_
  80. .. include:: explain_help.rst_
  81. .. include:: explain_grd_inout_short.rst_
  82. Examples
  83. --------
  84. .. include:: explain_example.rst_
  85. To determine area (in km^2), volume (in km^3), and mean height (in km) of all land areas
  86. (above zero contour) in the Hawaiian Islands from the remote grid @earth_relief_05m (height in m), use::
  87. gmt grdvolume @earth_relief_05m -R190/210/15/25 -C0 -Sk -Z0.001
  88. To find the volume below the surface peaks.nc and above the contour z = 250 m in meters, use
  89. ::
  90. gmt grdvolume peaks.nc -Se -C250
  91. To search for the contour, ranging from 100 to 300 in steps of 10, that
  92. maximizes the ratio of volume to surface area for the file peaks.nc, use
  93. ::
  94. gmt grdvolume peaks.nc -C0/300/10 -Th > results.d
  95. To see the areas and volumes for all the contours in the previous example, use
  96. ::
  97. gmt grdvolume peaks.nc -C100/300/10 > results.d
  98. To find the volume of water in a lake with its free surface at 0 and max depth of 300 meters, use
  99. ::
  100. gmt grdvolume lake.nc -Cr-300/0
  101. Volume integration
  102. ------------------
  103. The surface will be approximated using a bilinear expression for the *z*-value inside each grid box
  104. defined by four grid nodes: :math:`z(x,y) = z_0 + z_x^{'}x + z_y^{'}y + z_{xy}^{''}xy`, where the
  105. first term is the grid value at the lower left corner of the cell (where our relative coordinates
  106. *x* = *y* = 0). The primed *z*-values are derivatives in *x*, *y*, and both directions, respectively.
  107. We analytically integrate this expression within each box, allowing for straight line contour intersections
  108. to go through a box and affect the integration domain and limits.
  109. Notes
  110. -----
  111. #. The output of **grdvolume** is one or more records (one per contour if **-C**
  112. is set to search multiple contours) containing *contour area volume volume/area*.
  113. These records are written to standard output.
  114. #. For geographical grids we convert degrees to "Flat Earth" distances in
  115. meter. You can use **-S** to select another distance unit. The
  116. area is then reported in this unit squared while the volume is reported
  117. in unit^2 * z_unit quantities.
  118. #. **grdvolume** distinguishes between gridline and pixel-registered grids.
  119. In both cases the area and volume are computed up to the grid
  120. boundaries. That means that in the first case the grid cells on the
  121. boundary only contribute half their area (and volume), whereas in the
  122. second case all grid cells are fully used. The exception is when the
  123. **-C** flag is used: since contours do not extend beyond the outermost
  124. grid point, both grid types are treated the same. That means the outer
  125. rim in pixel oriented grids is ignored when using the **-C** flag.
  126. See Also
  127. --------
  128. :doc:`gmt`,
  129. :doc:`grdfilter`,
  130. :doc:`grdmask`,
  131. :doc:`grdmath`
  132. References
  133. ----------
  134. Wessel, P., 1998, An empirical method for optimal robust
  135. regional-residual separation of geophysical data, *Math. Geol.*, **30**\ (4), 391-408.
Tip!

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

Comments

Loading...