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

grdfft.rst 9.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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
  1. .. index:: ! grdfft
  2. .. include:: module_core_purpose.rst_
  3. ******
  4. grdfft
  5. ******
  6. |grdfft_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdfft** *ingrid* [ *ingrid2* ]
  11. [ |-G|\ *outfile*\|\ *table* ]
  12. [ |-A|\ *azimuth* ]
  13. [ |-C|\ *zlevel* ]
  14. [ |-D|\ [*scale*\|\ **g**] ]
  15. [ |-E|\ [**r**\|\ **x**\|\ **y**][**+w**\ [**k**]][**+n**] ]
  16. [ |-F|\ [**r**\|\ **x**\|\ **y**]\ *params* ]
  17. [ |-I|\ [*scale*\|\ **g**] ]
  18. [ |-N|\ *params* ]
  19. [ |-S|\ *scale* ]
  20. [ |SYN_OPT-V| ]
  21. [ |SYN_OPT-f| ]
  22. [ |SYN_OPT--| ]
  23. |No-spaces|
  24. Description
  25. -----------
  26. **grdfft** will take the 2-D forward Fast Fourier Transform and perform
  27. one or more mathematical operations in the frequency domain before
  28. transforming back to the space domain. An option is provided to scale
  29. the data before writing the new values to an output file. The horizontal
  30. dimensions of the grid are assumed to be in meters. Geographical grids
  31. may be used by specifying the |SYN_OPT-f| option that scales degrees to
  32. meters. If you have grids with dimensions in km, you could change this
  33. to meters using :doc:`grdedit` or scale the output with :doc:`grdmath`.
  34. Required Arguments
  35. ------------------
  36. *ingrid*
  37. 2-D binary grid file to be operated on. (See GRID FILE FORMATS
  38. below). For cross-spectral operations, also give the second grid
  39. file *ingrd2*.
  40. **-G**\ *outfile*
  41. Specify the name of the output grid file or the 1-D spectrum table
  42. (see **-E**). (See GRID FILE FORMATS below).
  43. Optional Arguments
  44. ------------------
  45. .. _-A:
  46. **-A**\ *azimuth*
  47. Take the directional derivative in the *azimuth* direction measured
  48. in degrees CW from north.
  49. .. _-C:
  50. **-C**\ *zlevel*
  51. Upward (for *zlevel* > 0) or downward (for *zlevel* < 0) continue
  52. the field *zlevel* meters.
  53. .. _-D:
  54. **-D**\ [*scale*\|\ **g**]
  55. Differentiate the field, i.e., take d(field)/dz. This is equivalent
  56. to multiplying by kr in the frequency domain (kr is radial wave
  57. number). Append a scale to multiply by (kr \* *scale*) instead.
  58. Alternatively, append **g** to indicate that your data are geoid
  59. heights in meters and output should be gravity anomalies in mGal.
  60. [Default is no scale].
  61. .. _-E:
  62. **-E**\ [**r**\|\ **x**\|\ **y**][**+w**\ [**k**]][**+n**]
  63. Estimate power spectrum in the radial direction [**r**]. Place
  64. **x** or **y** immediately after **-E** to compute the spectrum in
  65. the x or y direction instead. No grid file is created. If one grid
  66. is given then f (i.e., frequency or wave number), power[f],
  67. and 1 standard deviation in power[f] are written to the file set by
  68. **-G** [stdout]. If two grids are given we write f and 8 quantities:
  69. Xpower[f], Ypower[f], coherent power[f], noise power[f], phase[f],
  70. admittance[f], gain[f], coherency[f]. Each quantity is followed by
  71. its own 1-std dev error estimate, hence the output is 17 columns wide.
  72. Give **+w** to write wavelength instead of frequency, and if your grid
  73. is geographic you may further append **k** to scale wavelengths from
  74. meter [Default] to km. Finally, the spectrum is obtained by summing
  75. over several frequencies. Append **+n** to normalize so that the
  76. mean spectral values per frequency are reported instead.
  77. .. _-F:
  78. **-F**\ [**r**\|\ **x**\|\ **y**]\ *params*
  79. Filter the data. Place **x** or **y** immediately after **-F** to
  80. filter *x* or *y* direction only; default is isotropic [**r**].
  81. Choose between a cosine-tapered band-pass, a Gaussian band-pass
  82. filter, or a Butterworth band-pass filter.
  83. Cosine-taper:
  84. Specify four wavelengths *lc*/*lp*/*hp*/*hc* in correct units (see |SYN_OPT-f|)
  85. to design a bandpass filter: wavelengths greater than *lc* or less
  86. than *hc* will be cut, wavelengths greater than *lp* and less than
  87. *hp* will be passed, and wavelengths in between will be
  88. cosine-tapered. E.g., **-F**\ 1000000/250000/50000/10000 |SYN_OPT-f|
  89. will bandpass, cutting wavelengths > 1000 km and < 10 km, passing
  90. wavelengths between 250 km and 50 km. To make a highpass or lowpass
  91. filter, give hyphens (-) for *hp*/*hc* or *lc*/*lp*. E.g.,
  92. **-Fx**-/-/50/10 will lowpass *x*, passing wavelengths > 50 and
  93. rejecting wavelengths < 10. **-Fy**\ 1000/250/-/- will highpass *y*,
  94. passing wavelengths < 250 and rejecting wavelengths > 1000.
  95. Gaussian band-pass:
  96. Append *lo*/*hi*, the two wavelengths in correct units
  97. (see |SYN_OPT-f|) to design a bandpass filter. At the given wavelengths
  98. the Gaussian filter weights will be 0.5. To make a highpass or
  99. lowpass filter, give a hyphen (-) for the *hi* or *lo* wavelength,
  100. respectively. E.g., **-F**-/30 will lowpass the data using a
  101. Gaussian filter with half-weight at 30, while **-F**\ 400/- will
  102. highpass the data.
  103. Butterworth band-pass:
  104. Append *lo*/*hi*/*order*,
  105. the two wavelengths in correct units (see |SYN_OPT-f|) and the filter
  106. order (an integer) to design a bandpass filter. At the given cut-off
  107. wavelengths the Butterworth filter weights will be 0.707 (i.e., the
  108. power spectrum will therefore be reduced by 0.5). To make a
  109. highpass or lowpass filter, give a hyphen (-) for the *hi* or *lo*
  110. wavelength, respectively. E.g., **-F**-/30/2 will lowpass the data
  111. using a 2nd-order Butterworth filter, with half-weight at 30, while
  112. **-F**\ 400/-/2 will highpass the data.
  113. .. _-G:
  114. **-G**\ *outfile*\|\ *table*
  115. Filename for output netCDF grid file OR 1-D data table (see **-E**).
  116. This is optional for -E (spectrum written to stdout) but mandatory for
  117. all other options that require a grid output.
  118. .. _-I:
  119. **-I**\ [*scale*\|\ **g**]
  120. Integrate the field, i.e., compute integral\_over\_z (field \* dz).
  121. This is equivalent to divide by kr in the frequency domain (kr is
  122. radial wave number). Append a scale to divide by (kr \* *scale*)
  123. instead. Alternatively, append **g** to indicate that your data set
  124. is gravity anomalies in mGal and output should be geoid heights in
  125. meters. [Default is no scale].
  126. .. include:: explain_fft.rst_
  127. .. _-S:
  128. **-S**\ *scale*
  129. Multiply each element by *scale* in the space domain (after the
  130. frequency domain operations). [Default is 1.0].
  131. .. _-V:
  132. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  133. .. include:: explain_-V.rst_
  134. |SYN_OPT-f|
  135. Geographic grids (dimensions of longitude, latitude) will be converted to
  136. meters via a "Flat Earth" approximation using the current ellipsoid parameters.
  137. .. include:: explain_help.rst_
  138. .. include:: explain_grd_inout_short.rst_
  139. Grid Distance Units
  140. -------------------
  141. If the grid does not have meter as the horizontal unit, append **+u**\ *unit* to the input file name to convert from the
  142. specified unit to meter. If your grid is geographic, convert distances to meters by supplying |SYN_OPT-f| instead.
  143. Considerations
  144. --------------
  145. netCDF COARDS grids will automatically be recognized as geographic. For
  146. other grids geographical grids were you want to convert degrees into
  147. meters, select |SYN_OPT-f|. If the data are close to either pole, you should
  148. consider projecting the grid file onto a rectangular coordinate system
  149. using :doc:`grdproject`
  150. Normalization of Spectrum
  151. -------------------------
  152. By default, the power spectrum returned by **-E** simply sums the contributions
  153. from frequencies that are part of the output frequency. For *x*- or *y*-spectra
  154. this means summing the power across the other frequency dimension, while for the
  155. radial spectrum it means summing up power within each annulus of width *delta_q*,
  156. the radial frequency (*q*) spacing. A consequence of this summing is that the radial
  157. spectrum of a white noise process will give a linear radial power spectrum that
  158. is proportional to *q*. Appending **n** will instead compute the mean power
  159. per output frequency and in this case the white noise process will have a
  160. white radial spectrum as well.
  161. Examples
  162. --------
  163. .. include:: explain_example.rst_
  164. To obtain the normalized radial spectrum from the remote data grid @white_noise.nc,
  165. after removing the mean, let us try::
  166. gmt grdfft @white_noise.nc -Er+n -N+a > spectrum.txt
  167. To upward continue the sea-level magnetic anomalies in the file
  168. mag_0.nc to a level 800 m above sealevel:
  169. ::
  170. gmt grdfft mag_0.nc -C800 -V -Gmag_800.nc
  171. To transform geoid heights in m (geoid.nc) on a geographical grid to
  172. free-air gravity anomalies in mGal:
  173. ::
  174. gmt grdfft geoid.nc -Dg -V -Ggrav.nc
  175. To transform gravity anomalies in mGal (faa.nc) to deflections of the
  176. vertical (in micro-radians) in the 038 direction, we must first
  177. integrate gravity to get geoid, then take the directional derivative,
  178. and finally scale radians to micro-radians:
  179. ::
  180. gmt grdfft faa.nc -Ig -A38 -S1e6 -V -Gdefl_38.nc
  181. Second vertical derivatives of gravity anomalies are related to the
  182. curvature of the field. We can compute these as mGal/m^2 by
  183. differentiating twice:
  184. ::
  185. gmt grdfft gravity.nc -D -D -V -Ggrav_2nd_derivative.nc
  186. To compute cross-spectral estimates for co-registered bathymetry and
  187. gravity grids, and report result as functions of wavelengths in km, try
  188. ::
  189. gmt grdfft bathymetry.nc gravity.grd -E+wk -fg -V > cross_spectra.txt
  190. To examine the pre-FFT grid after detrending, point-symmetry reflection,
  191. and tapering has been applied, as well as saving the real and imaginary
  192. components of the raw spectrum of the data in topo.nc, try
  193. ::
  194. gmt grdfft topo.nc -N+w+z -fg -V
  195. You can now make plots of the data in topo_taper.nc, topo_real.nc, and topo_imag.nc.
  196. See Also
  197. --------
  198. :doc:`gmt`, :doc:`grdedit`,
  199. :doc:`grdfilter`,
  200. :doc:`grdmath`,
  201. :doc:`grdproject`,
  202. :doc:`gravfft <supplements/potential/gravfft>`
Tip!

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

Comments

Loading...