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

grdproject.rst 7.0 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
  1. .. index:: ! grdproject
  2. .. include:: module_core_purpose.rst_
  3. **********
  4. grdproject
  5. **********
  6. |grdproject_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdproject** *in_grdfile* |-G|\ *out_grdfile* |-J|\ *parameters*
  11. [ |-C|\ [*dx/dy*] ]
  12. [ |-D|\ *xinc*\ [**+e**\|\ **n**][/\ *yinc*\ [**+e**\|\ **n**]] ]
  13. [ |-E|\ *dpi* ] [ |-F|\ [**c**\|\ **i**\|\ **p**\|\ **e**\|\ **f**\|\ **k**\|\ **M**\|\ **n**\|\ **u**] ] [ |-I| ] [ |-M|\ **c**\|\ **i**\|\ **p** ]
  14. [ |SYN_OPT-R| ]
  15. [ |SYN_OPT-V| ]
  16. [ |SYN_OPT-n| ]
  17. [ |SYN_OPT-r| ]
  18. [ |SYN_OPT--| ]
  19. |No-spaces|
  20. Description
  21. -----------
  22. **grdproject** will do one of two things depending whether **-I** has
  23. been set. If set, it will transform a gridded data set from a
  24. rectangular coordinate system onto a geographical system by resampling
  25. the surface at the new nodes. If not set, it will project a geographical
  26. gridded data set onto a rectangular grid. To obtain the value at each
  27. new node, its location is inversely projected back onto the input grid
  28. after which a value is interpolated between the surrounding input grid
  29. values. By default bi-cubic interpolation is used. Aliasing is avoided
  30. by also forward projecting the input grid nodes. If two or more nodes
  31. are projected onto the same new node, their average will dominate in the
  32. calculation of the new node value. Interpolation and aliasing is
  33. controlled with the **-n** option. The new node spacing may be
  34. determined in one of several ways by specifying the grid spacing, number
  35. of nodes, or resolution. Nodes not constrained by input data are set to
  36. NaN.
  37. The **-R** option can be used to select a map region larger or smaller
  38. than that implied by the extent of the grid file.
  39. Required Arguments
  40. ------------------
  41. *in_grdfile*
  42. 2-D binary grid file to be transformed. (See GRID FILE FORMATS below.)
  43. .. _-G:
  44. **-G**\ *out_grdfile*
  45. Specify the name of the output grid file. (See GRID FILE FORMATS below.)
  46. .. _-J:
  47. .. |Add_-J| unicode:: 0x20 .. just an invisible code
  48. .. include:: explain_-J.rst_
  49. Optional Arguments
  50. ------------------
  51. .. _-C:
  52. **-C**\ [*dx/dy*]
  53. Let projected coordinates be relative to projection center [Default
  54. is relative to lower left corner]. Optionally, add offsets in the
  55. projected units to be added (or subtracted when **-I** is set) to
  56. (from) the projected coordinates, such as false eastings and
  57. northings for particular projection zones [0/0].
  58. .. _-D:
  59. **-D**\ *xinc*\ [**+e**\|\ **n**][/\ *yinc*\ [**+e**\|\ **n**]]
  60. Set the grid spacing for the new grid. If neither **-D** nor **-E** are set then we
  61. select the same number of output nodes as there are input nodes.
  62. Optionally append a suffix modifier.
  63. **Geographical (degrees) coordinates**: Append
  64. **m** to indicate arc minutes or **s** to indicate arc seconds. If one
  65. of the units **e**, **f**, **k**, **M**, **n** or **u** is appended
  66. instead, the increment is assumed to be given in meter, foot, km, Mile,
  67. nautical mile or US survey foot, respectively, and will be converted to
  68. the equivalent degrees longitude at the middle latitude of the region
  69. (the conversion depends on :term:`PROJ_ELLIPSOID`). If *y_inc* is given
  70. but set to 0 it will be reset equal to *x_inc*; otherwise it will be
  71. converted to degrees latitude. **All coordinates**: If **+e** is appended
  72. then the corresponding max *x* (*east*) or *y* (*north*) may be slightly
  73. adjusted to fit exactly the given increment [by default the increment
  74. may be adjusted slightly to fit the given domain]. Finally, instead of
  75. giving an increment you may specify the *number of nodes* desired by
  76. appending **+n** to the supplied integer argument; the increment is then
  77. recalculated from the number of nodes and the domain. The resulting
  78. increment value depends on whether you have selected a
  79. gridline-registered or pixel-registered grid; see :ref:`GMT File Formats` for
  80. details. **Note**: If **-R**\ *grdfile* is used then the grid spacing (and registration) have
  81. already been initialized; use **-D** (and **-r**) to override the values.
  82. .. _-E:
  83. **-E**\ *dpi*
  84. Set the resolution for the new grid in dots per inch.
  85. .. _-F:
  86. **-F**\ [**c**\|\ **i**\|\ **p**\|\ **e**\|\ **f**\|\ **k**\|\ **M**\|\ **n**\|\ **u**]
  87. Force 1:1 scaling, i.e., output (or input, see **-I**) data are in
  88. actual projected meters [**e**]. To specify other units, append
  89. **f** (foot), **k** (km), **M** (statute mile), **n** (nautical
  90. mile), **u** (US survey foot), **i** (inch), **c** (cm), or **p**
  91. (point). Without **-F**, the output (or input, see **-I**) are in
  92. the units specified by :term:`PROJ_LENGTH_UNIT` (but see **-M**).
  93. .. _-I:
  94. **-I**
  95. Do the Inverse transformation, from rectangular to geographical.
  96. .. _-M:
  97. **-Mc**\|\ **i**\|\ **p**
  98. Append **c**, **i**, or **p** to indicate that cm, inch, or point
  99. should be the projected measure unit [Default is set by
  100. :term:`PROJ_LENGTH_UNIT` in :doc:`gmt.conf`]. Cannot be used with **-F**.
  101. .. _-R:
  102. .. |Add_-R| replace:: You may ask to project only
  103. a subset of the grid by specifying a smaller input *w/e/s/n* region
  104. [Default is the region given by the grid file].
  105. .. include:: explain_-R.rst_
  106. .. _-V:
  107. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  108. .. include:: explain_-V.rst_
  109. .. include:: explain_-n.rst_
  110. .. |Add_nodereg| unicode:: 0x20 .. just an invisible code
  111. .. include:: explain_nodereg.rst_
  112. .. include:: explain_help.rst_
  113. .. include:: explain_grd_inout_short.rst_
  114. Examples
  115. --------
  116. .. include:: explain_example.rst_
  117. To transform a chunk of the geographical remote grid earth_relief_05m onto a pixel Mercator grid at 300 dpi
  118. given a scale of 0.25 inches per degree, run
  119. ::
  120. gmt grdproject @earth_relief_05m -R20/50/12/25 -Jm0.25i -E300 -r -Getopo5_merc.nc -Mi
  121. To inversely transform the file topo_tm.nc back onto a geographical grid, use
  122. ::
  123. gmt grdproject topo_tm.nc -R-80/-70/20/40 -Jt-75/1:500000 -I -D5m -V -Gtopo.nc
  124. This assumes, of course, that the coordinates in topo_tm.nc were
  125. created with the same projection parameters.
  126. To inversely transform the file topo_utm.nc (which is in UTM meters)
  127. back to a geographical grid we specify a one-to-one mapping with meter
  128. as the measure unit:
  129. ::
  130. gmt grdproject topo_utm.nc -R203/205/60/65 -Ju5/1:1 -I -Gtopo.nc -V
  131. To inversely transform the file data.nc (which is in Mercator meters with Greenwich
  132. as the central longitude and a false easting of -4 and produced on the ellipse WGS-72)
  133. back to a geographical grid we specify a one-to-one mapping with meter
  134. as the measure unit:
  135. ::
  136. gmt grdproject data.nc -Jm/1:1 -I -F -C-4/0 -Gdata_geo.nc -V --PROJ_ELLIPSOID=WGS-72
  137. Restrictions
  138. ------------
  139. The boundaries of a projected (rectangular) data set will not
  140. necessarily give rectangular geographical boundaries (Mercator is one
  141. exception). In those cases some nodes may be unconstrained (set to NaN).
  142. To get a full grid back, your input grid may have to cover a larger area
  143. than you are interested in.
  144. See Also
  145. --------
  146. :doc:`gmt`, :doc:`gmt.conf`, :doc:`mapproject`
Tip!

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

Comments

Loading...