Skip to content

Commit

Permalink
feat: add ANTGG2021 gravity compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Nov 18, 2024
1 parent 215bb31 commit b23c97b
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 25 deletions.
108 changes: 83 additions & 25 deletions docs/datasets/antarctica/gravity.ipynb

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions src/polartoolkit/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2537,6 +2537,10 @@ def gravity(
Updates on 2016 AntGG compilation.
Accessed from https://ftp.space.dtu.dk/pub/RF/4D-ANTARCTICA/
version='antgg-2021'
Updates on 2016 AntGG compilation.
Accessed from https://doi.pangaea.de/10.1594/PANGAEA.971238?format=html#download
version='eigen'
Earth gravity grid (eigen-6c4) at 10 arc-min resolution at 10km geometric
(ellipsoidal) height from :footcite:t:`forsteeigen6c42014`.
Expand Down Expand Up @@ -2708,6 +2712,65 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str:
**kwargs,
)

elif version == "antgg-2021":
# found with utils.get_grid_info()
initial_region = (-3330000.0, 3330000.0, -3330000.0, 3330000.0)
initial_spacing = 5e3
initial_registration = "g"

# if region is None:
# region = initial_region
# if spacing is None:
# spacing = initial_spacing
# if registration is None:
# registration = initial_registration

if anomaly_type == "FA":
url = "https://download.pangaea.de/dataset/971238/files/AntGG2021_Gravity-anomaly.nc"
fname = "antgg_2021_FA.nc"
elif anomaly_type == "DG":
url = "https://download.pangaea.de/dataset/971238/files/AntGG2021_Gravity_disturbance_at-surface.nc"
fname = "antgg_2021_DG.nc"
elif anomaly_type == "BA":
url = "https://download.pangaea.de/dataset/971238/files/AntGG2021_Bouguer-anomaly.nc"
fname = "antgg_2021_BA.nc"
elif anomaly_type == "Err":
url = "https://download.pangaea.de/dataset/971238/files/AntGG2021_Standard-deviation_GA-from-LSC.nc"
fname = "antgg_2021_Err.nc"
else:
msg = "invalid anomaly type"
raise ValueError(msg)

path = pooch.retrieve(
url=url,
fname=fname,
path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity",
known_hash=None,
progressbar=True,
)

file = xr.load_dataset(path)

if anomaly_type == "FA":
file = file.grav_anom
elif anomaly_type == "DG":
file = file.grav_dist
elif anomaly_type == "BA":
file = file.Boug_anom
elif anomaly_type == "Err":
file = file.std_grav_anom

resampled = resample_grid(
file,
initial_spacing,
initial_region,
initial_registration,
spacing,
region,
registration,
**kwargs,
)

elif version == "eigen":
initial_region = (-3330000.0, 3330000.0, -3330000.0, 3330000.0)
initial_spacing = 5e3
Expand Down
10 changes: 10 additions & 0 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,16 @@ def test_bedmap_points():
"g",
),
),
(
"antgg-2021",
(
5000,
(-3330000.0, 3330000.0, -3330000.0, 3330000.0),
-250.750549316,
308.477203369,
"g",
),
),
(
"eigen",
(
Expand Down

0 comments on commit b23c97b

Please sign in to comment.