|
13 | 13 | import pygmt |
14 | 14 | import verde as vd |
15 | 15 | import xarray as xr |
16 | | -import xrft |
17 | 16 |
|
18 | 17 | import harmonica as hm |
19 | 18 |
|
|
22 | 21 | fname = ensaio.fetch_lightning_creek_magnetic(version=1) |
23 | 22 | magnetic_grid = xr.load_dataarray(fname) |
24 | 23 |
|
25 | | -# Pad the grid to increase accuracy of the FFT filter |
26 | | -pad_width = { |
27 | | - "easting": magnetic_grid.easting.size // 3, |
28 | | - "northing": magnetic_grid.northing.size // 3, |
29 | | -} |
30 | | -# drop the extra height coordinate |
31 | | -magnetic_grid_no_height = magnetic_grid.drop_vars("height") |
32 | | -magnetic_grid_padded = xrft.pad(magnetic_grid_no_height, pad_width) |
33 | | - |
34 | 24 | # Compute the tilt of the grid |
35 | | -tilt_grid = hm.tilt_angle(magnetic_grid_padded) |
36 | | - |
37 | | -# Unpad the tilt grid |
38 | | -tilt_grid = xrft.unpad(tilt_grid, pad_width) |
39 | | - |
| 25 | +tilt_grid = hm.tilt_angle(magnetic_grid) |
40 | 26 | # Show the tilt |
41 | 27 | print("\nTilt:\n", tilt_grid) |
42 | 28 |
|
|
47 | 33 | # Apply a reduction to the pole over the magnetic anomaly grid. We will assume |
48 | 34 | # that the sources share the same inclination and declination as the |
49 | 35 | # geomagnetic field. |
50 | | -rtp_grid_padded = hm.reduction_to_pole( |
51 | | - magnetic_grid_padded, inclination=inclination, declination=declination |
| 36 | +rtp_grid = hm.reduction_to_pole( |
| 37 | + magnetic_grid, inclination=inclination, declination=declination |
52 | 38 | ) |
53 | 39 |
|
54 | | -# Unpad the reduced to the pole grid |
55 | | -rtp_grid = xrft.unpad(rtp_grid_padded, pad_width) |
56 | | - |
57 | 40 | # Compute the tilt of the padded rtp grid |
58 | | -tilt_rtp_grid = hm.tilt_angle(rtp_grid_padded) |
59 | | - |
60 | | -# Unpad the tilt grid |
61 | | -tilt_rtp_grid = xrft.unpad(tilt_rtp_grid, pad_width) |
62 | | - |
| 41 | +tilt_rtp_grid = hm.tilt_angle(rtp_grid) |
63 | 42 | # Show the tilt from RTP |
64 | 43 | print("\nTilt from RTP:\n", tilt_rtp_grid) |
65 | 44 |
|
|
0 commit comments