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

grdcut.rst 4.6 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
  1. .. index:: ! grdcut
  2. .. include:: module_core_purpose.rst_
  3. ******
  4. grdcut
  5. ******
  6. |grdcut_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdcut** *ingrid* |-G|\ *outgrid*
  11. |SYN_OPT-R|
  12. [ |-J|\ *parameters* ]
  13. [ |-N|\ [*nodata*] ]
  14. [ |-S|\ *lon/lat/radius*\ [**+n**] ]
  15. [ |SYN_OPT-V| ]
  16. [ |-Z|\ [*min/max*]\ [**+n**\|\ **N**\|\ **r**] ]
  17. [ |SYN_OPT-f| ]
  18. [ |SYN_OPT--| ]
  19. |No-spaces|
  20. Description
  21. -----------
  22. **grdcut** will produce a new *outgrid* file which is a subregion of
  23. *ingrid*. The subregion is specified with **-R** as in other programs;
  24. the specified range must not exceed the range of *ingrid* (but see **-N**).
  25. If in doubt, run :doc:`grdinfo` to check range. Alternatively, define the subregion
  26. indirectly via a range check on the node values or via distances from a
  27. given point. Finally, you can use **-J** for oblique projections to determine
  28. the corresponding rectangular **-R** setting that will give a grid that fully
  29. covers the oblique domain.
  30. Complementary to **grdcut** there is :doc:`grdpaste`, which
  31. will join together two grid files along a common edge.
  32. Required Arguments
  33. ------------------
  34. *ingrid*
  35. This is the input grid file.
  36. .. _-G:
  37. **-G**\ *outgrid*
  38. This is the output grid file.
  39. Optional Arguments
  40. ------------------
  41. .. _-J:
  42. .. |Add_-J| unicode:: 0x20 .. just an invisible code
  43. .. include:: explain_-J.rst_
  44. .. _-N:
  45. **-N**\ [*nodata*]
  46. Allow grid to be extended if new **-R** exceeds existing boundaries.
  47. Append *nodata* value to initialize nodes outside current region [Default is NaN].
  48. .. _-R:
  49. .. |Add_-R| replace:: This defines the subregion to be cut out.
  50. .. include:: explain_-R.rst_
  51. .. _-S:
  52. **-S**\ *lon/lat/radius*\ [**+n**]
  53. Specify an origin and radius; append a distance unit (see `Units`_) and
  54. we determine the corresponding rectangular region so that all grid
  55. nodes on or inside the circle are contained in the subset. If
  56. **+n** is appended we set all nodes outside the circle to NaN.
  57. .. _-V:
  58. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  59. .. include:: explain_-V.rst_
  60. .. _-Z:
  61. **-Z**\ [*min/max*]\ [**+n**\|\ **N**\|\ **r**]
  62. Determine a new rectangular region so that all nodes *outside* this
  63. region are also outside the given *z*-range [-inf/+inf]. To indicate
  64. no limit on min or max only, specify a hyphen (-). Normally, any NaNs
  65. encountered are simply skipped and not considered in the range-decision.
  66. Append **+n** to consider a NaN to be outside the given *z*-range. This means
  67. the new subset will be NaN-free. Alternatively, append **+r** to
  68. consider NaNs to be within the data range. In this case we stop
  69. shrinking the boundaries once a NaN is found [Default simply skips NaNs
  70. when making the range decision]. Finally, if your core subset grid is
  71. surrounded by rows and/or columns that are all NaNs, append **+N** to
  72. strip off such columns before (optionally) considering the range of the
  73. core subset for further reduction of the area.
  74. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  75. .. include:: explain_-f.rst_
  76. .. include:: explain_help.rst_
  77. .. include:: explain_distunits.rst_
  78. .. include:: explain_grd_inout_short.rst_
  79. .. include:: explain_grd_coord.rst_
  80. Examples
  81. --------
  82. .. include:: explain_example.rst_
  83. To obtain data for an oblique Mercator projection map we need to extract
  84. more data that is actually used. This is necessary because the output of
  85. **grdcut** has edges defined by parallels and meridians, while the
  86. oblique map in general does not. Hence, to get all the data from the
  87. ETOPO2 data needed to make a contour map for the region defined by its
  88. lower left and upper right corners and the desired projection, use::
  89. gmt grdcut @earth_relief_02m -R160/20/220/30+r -Joc190/25.5/292/69/1 -Gdata.nc
  90. Suppose you have used :doc:`surface` to grid ship gravity in the region
  91. between 148E - 162E and 8N - 32N, and you do not trust the gridding near
  92. the edges, so you want to keep only the area between 150E - 160E and 10N - 30N, then::
  93. gmt grdcut grav_148_162_8_32.nc -Ggrav_150_160_10_30.nc -R150/160/10/30 -V
  94. To return the subregion of a grid such that any boundary strips where
  95. all values are entirely above 0 are excluded, try::
  96. gmt grdcut bathy.nc -Gtrimmed_bathy.nc -Z-/0 -V
  97. To return the subregion of a grid such that any boundary rows or columns
  98. that are all NaNs, try::
  99. gmt grdcut bathy.nc -Gtrimmed_bathy.nc -Z+N -V
  100. To return the subregion of a grid that contains all nodes within a
  101. distance of 500 km from the point 45,30 try::
  102. gmt grdcut bathy.nc -Gsubset_bathy.nc -S45/30/500k -V
  103. See Also
  104. --------
  105. :doc:`gmt`,
  106. :doc:`grdclip`,
  107. :doc:`grdfill`,
  108. :doc:`grdinfo`,
  109. :doc:`grdpaste`,
  110. :doc:`surface`
Tip!

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

Comments

Loading...