diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index b631fe49834..1370ff3ab3e 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -20,7 +20,7 @@ grid = pygmt.datasets.load_earth_relief( resolution="03s", region=[-119.825, -119.4, 37.6, 37.825] ) -grid_dist = pygmt.grd2xyz(grid=grid, output_type="pandas")["elevation"] +grid_dist = pygmt.grd2xyz(grid=grid, output_type="pandas")["z"] # %% diff --git a/pygmt/datasets/earth_free_air_anomaly.py b/pygmt/datasets/earth_free_air_anomaly.py index 00abae85122..9beae54ef1a 100644 --- a/pygmt/datasets/earth_free_air_anomaly.py +++ b/pygmt/datasets/earth_free_air_anomaly.py @@ -1,5 +1,5 @@ """ -Function to download the IGPP Earth Free-Air Anomaly dataset from the GMT data server, +Function to download the IGPP Earth free-air anomaly dataset from the GMT data server, and load as :class:`xarray.DataArray`. The grids are available in various resolutions. @@ -20,13 +20,13 @@ def load_earth_free_air_anomaly( registration: Literal["gridline", "pixel", None] = None, ): r""" - Load the IGPP Earth Free-Air Anomaly dataset in various resolutions. + Load the IGPP Earth free-air anomaly dataset in various resolutions. .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_faa.jpg :width: 80 % :align: center - IGPP Earth Free-Air Anomaly dataset. + IGPP Earth free-air anomaly dataset. The grids are downloaded to a user data directory (usually ``~/.gmt/server/earth/earth_faa/``) the first time you invoke @@ -102,7 +102,7 @@ def load_earth_free_air_anomaly( ... ) """ grid = _load_remote_dataset( - dataset_name="earth_free_air_anomaly", + dataset_name="earth_faa", dataset_prefix="earth_faa_", resolution=resolution, region=region, diff --git a/pygmt/datasets/earth_geoid.py b/pygmt/datasets/earth_geoid.py index e62fb20bdf3..8965e06857d 100644 --- a/pygmt/datasets/earth_geoid.py +++ b/pygmt/datasets/earth_geoid.py @@ -1,5 +1,5 @@ """ -Function to download the EGM2008 Earth Geoid dataset from the GMT data server, and load +Function to download the EGM2008 Earth geoid dataset from the GMT data server, and load as :class:`xarray.DataArray`. The grids are available in various resolutions. @@ -20,13 +20,13 @@ def load_earth_geoid( registration: Literal["gridline", "pixel"] = "gridline", ): r""" - Load the EGM2008 Earth Geoid dataset in various resolutions. + Load the EGM2008 Earth geoid dataset in various resolutions. .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_geoid.jpg :width: 80 % :align: center - EGM2008 Earth Geoid dataset. + EGM2008 Earth geoid dataset. The grids are downloaded to a user data directory (usually ``~/.gmt/server/earth/earth_geoid/``) the first time you invoke diff --git a/pygmt/datasets/earth_magnetic_anomaly.py b/pygmt/datasets/earth_magnetic_anomaly.py index 7eb1552bbc8..e8d7afe1684 100644 --- a/pygmt/datasets/earth_magnetic_anomaly.py +++ b/pygmt/datasets/earth_magnetic_anomaly.py @@ -147,7 +147,7 @@ def load_earth_magnetic_anomaly( "Valid values are 'emag2', 'emag2_4km', and 'wdmam'." ) dataset_prefix = magnetic_anomaly_sources[data_source] - dataset_name = "earth_wdmam" if data_source == "wdmam" else "earth_magnetic_anomaly" + dataset_name = "earth_wdmam" if data_source == "wdmam" else "earth_mag" grid = _load_remote_dataset( dataset_name=dataset_name, dataset_prefix=dataset_prefix, diff --git a/pygmt/datasets/earth_mask.py b/pygmt/datasets/earth_mask.py index cd38b5bc5c2..1c439ec32d5 100644 --- a/pygmt/datasets/earth_mask.py +++ b/pygmt/datasets/earth_mask.py @@ -20,13 +20,13 @@ def load_earth_mask( registration: Literal["gridline", "pixel"] = "gridline", ): r""" - Load the GSHHG Earth Mask dataset in various resolutions. + Load the GSHHG Earth mask dataset in various resolutions. .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_mask.jpg :width: 80 % :align: center - GSHHG Earth Mask dataset. + GSHHG Earth mask dataset. The grids are downloaded to a user data directory (usually ``~/.gmt/server/earth/earth_mask/``) the first time you invoke diff --git a/pygmt/datasets/earth_relief.py b/pygmt/datasets/earth_relief.py index e87f2b403fe..a0ddcd6eabc 100644 --- a/pygmt/datasets/earth_relief.py +++ b/pygmt/datasets/earth_relief.py @@ -161,9 +161,14 @@ def load_earth_relief( ) else: dataset_prefix = earth_relief_sources[data_source] - + # Choose earth relief dataset + match data_source: + case "igpp" | "synbath": + dataset_name = "earth_igpp" + case "gebco" | "gebcosi": + dataset_name = "earth_gebco" grid = _load_remote_dataset( - dataset_name="earth_relief", + dataset_name=dataset_name, dataset_prefix=dataset_prefix, resolution=resolution, region=region, diff --git a/pygmt/datasets/earth_vertical_gravity_gradient.py b/pygmt/datasets/earth_vertical_gravity_gradient.py index da5fc880766..53e11e229c1 100644 --- a/pygmt/datasets/earth_vertical_gravity_gradient.py +++ b/pygmt/datasets/earth_vertical_gravity_gradient.py @@ -1,5 +1,5 @@ """ -Function to download the IGPP Earth Vertical Gravity Gradient dataset from the GMT data +Function to download the IGPP Earth vertical gravity gradient dataset from the GMT data server, and load as :class:`xarray.DataArray`. The grids are available in various resolutions. @@ -20,13 +20,13 @@ def load_earth_vertical_gravity_gradient( registration: Literal["gridline", "pixel", None] = None, ): r""" - Load the IGPP Earth Vertical Gravity Gradient dataset in various resolutions. + Load the IGPP Earth vertical gravity gradient dataset in various resolutions. .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_vgg.jpg :width: 80 % :align: center - IGPP Earth Vertical Gravity Gradient dataset. + IGPP Earth vertical gravity gradient dataset. The grids are downloaded to a user data directory (usually ``~/.gmt/server/earth/earth_vgg/``) the first time you invoke diff --git a/pygmt/datasets/load_remote_dataset.py b/pygmt/datasets/load_remote_dataset.py index 5b66a14057d..6f099952512 100644 --- a/pygmt/datasets/load_remote_dataset.py +++ b/pygmt/datasets/load_remote_dataset.py @@ -41,13 +41,9 @@ class GMTRemoteDataset(NamedTuple): Attributes ---------- - title : str - The title of the dataset, used in error messages. - name : str - The name assigned as an attribute to the DataArray. - long_name : str - The long name assigned as an attribute to the DataArray. - units : str + description : str + The name assigned as an attribute to the DataArray. + units : str, None The units of the values in the DataArray. resolutions : dict Dictionary of available resolution as keys and Resolution objects as values. @@ -55,9 +51,7 @@ class GMTRemoteDataset(NamedTuple): A dictionary of extra or unique attributes of the dataset. """ - title: str - name: str - long_name: str + description: str units: str | None resolutions: dict[str, Resolution] extra_attributes: dict @@ -65,9 +59,7 @@ class GMTRemoteDataset(NamedTuple): datasets = { "earth_age": GMTRemoteDataset( - title="seafloor age", - name="seafloor_age", - long_name="age of seafloor crust", + description="EarthByte Earth seafloor crustal age", units="Myr", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -84,10 +76,8 @@ class GMTRemoteDataset(NamedTuple): "01m": Resolution("01m", registrations=["gridline"], tiled=True), }, ), - "earth_free_air_anomaly": GMTRemoteDataset( - title="free air anomaly", - name="free_air_anomaly", - long_name="IGPP Earth Free-Air Anomaly", + "earth_faa": GMTRemoteDataset( + description="IGPP Earth free-air anomaly", units="mGal", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -104,10 +94,30 @@ class GMTRemoteDataset(NamedTuple): "01m": Resolution("01m", registrations=["pixel"], tiled=True), }, ), + "earth_gebco": GMTRemoteDataset( + description="GEBCO Earth relief", + units="meters", + extra_attributes={"vertical_datum": "EGM96", "horizontal_datum": "WGS84"}, + resolutions={ + "01d": Resolution("01d"), + "30m": Resolution("30m"), + "20m": Resolution("20m"), + "15m": Resolution("15m"), + "10m": Resolution("10m"), + "06m": Resolution("06m"), + "05m": Resolution("05m", tiled=True), + "04m": Resolution("04m", tiled=True), + "03m": Resolution("03m", tiled=True), + "02m": Resolution("02m", tiled=True), + "01m": Resolution("01m", tiled=True), + "30s": Resolution("30s", tiled=True), + "15s": Resolution("15s", registrations=["pixel"], tiled=True), + "03s": Resolution("03s", registrations=["gridline"], tiled=True), + "01s": Resolution("01s", registrations=["gridline"], tiled=True), + }, + ), "earth_geoid": GMTRemoteDataset( - title="Earth geoid", - name="earth_geoid", - long_name="EGM2008 Earth Geoid", + description="EGM2008 Earth geoid", units="m", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -124,10 +134,30 @@ class GMTRemoteDataset(NamedTuple): "01m": Resolution("01m", registrations=["gridline"], tiled=True), }, ), - "earth_magnetic_anomaly": GMTRemoteDataset( - title="Earth magnetic anomaly", - name="magnetic_anomaly", - long_name="Earth magnetic anomaly", + "earth_igpp": GMTRemoteDataset( + description="IGPP Earth relief", + units="meters", + extra_attributes={"vertical_datum": "EGM96", "horizontal_datum": "WGS84"}, + resolutions={ + "01d": Resolution("01d"), + "30m": Resolution("30m"), + "20m": Resolution("20m"), + "15m": Resolution("15m"), + "10m": Resolution("10m"), + "06m": Resolution("06m"), + "05m": Resolution("05m", tiled=True), + "04m": Resolution("04m", tiled=True), + "03m": Resolution("03m", tiled=True), + "02m": Resolution("02m", tiled=True), + "01m": Resolution("01m", tiled=True), + "30s": Resolution("30s", tiled=True), + "15s": Resolution("15s", registrations=["pixel"], tiled=True), + "03s": Resolution("03s", registrations=["gridline"], tiled=True), + "01s": Resolution("01s", registrations=["gridline"], tiled=True), + }, + ), + "earth_mag": GMTRemoteDataset( + description="EMAG2 Earth Magnetic Anomaly Model", units="nT", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -144,9 +174,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "earth_mask": GMTRemoteDataset( - title="Earth mask", - name="earth_mask", - long_name="Mask of land and water features", + description="GSHHG Earth mask", units=None, extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -165,34 +193,8 @@ class GMTRemoteDataset(NamedTuple): "15s": Resolution("15s"), }, ), - "earth_relief": GMTRemoteDataset( - title="Earth relief", - name="elevation", - long_name="Earth elevation relative to the geoid", - units="meters", - extra_attributes={"vertical_datum": "EGM96", "horizontal_datum": "WGS84"}, - resolutions={ - "01d": Resolution("01d"), - "30m": Resolution("30m"), - "20m": Resolution("20m"), - "15m": Resolution("15m"), - "10m": Resolution("10m"), - "06m": Resolution("06m"), - "05m": Resolution("05m", tiled=True), - "04m": Resolution("04m", tiled=True), - "03m": Resolution("03m", tiled=True), - "02m": Resolution("02m", tiled=True), - "01m": Resolution("01m", tiled=True), - "30s": Resolution("30s", tiled=True), - "15s": Resolution("15s", registrations=["pixel"], tiled=True), - "03s": Resolution("03s", registrations=["gridline"], tiled=True), - "01s": Resolution("01s", registrations=["gridline"], tiled=True), - }, - ), "earth_vgg": GMTRemoteDataset( - title="Earth vertical gravity gradient", - name="earth_vgg", - long_name="IGPP Earth Vertical Gravity Gradient", + description="IGPP Earth vertical gravity gradient", units="Eotvos", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -210,9 +212,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "earth_wdmam": GMTRemoteDataset( - title="WDMAM magnetic anomaly", - name="wdmam", - long_name="World Digital Magnetic Anomaly Map", + description="WDMAM World Digital Magnetic Anomaly Map", units="nT", extra_attributes={"horizontal_datum": "WGS84"}, resolutions={ @@ -228,9 +228,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "mars_relief": GMTRemoteDataset( - title="Mars relief", - name="mars_relief", - long_name="NASA Mars (MOLA) relief", + description="NASA Mars (MOLA) relief", units="meters", extra_attributes={}, resolutions={ @@ -251,9 +249,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "moon_relief": GMTRemoteDataset( - title="Moon relief", - name="moon_relief", - long_name="USGS Moon (LOLA) relief", + description="USGS Moon (LOLA) relief", units="meters", extra_attributes={}, resolutions={ @@ -274,9 +270,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "mercury_relief": GMTRemoteDataset( - title="Mercury relief", - name="mercury_relief", - long_name="USGS Mercury relief", + description="USGS Mercury relief", units="meters", extra_attributes={}, resolutions={ @@ -295,9 +289,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "pluto_relief": GMTRemoteDataset( - title="Pluto relief", - name="pluto_relief", - long_name="USGS Pluto relief", + description="USGS Pluto relief", units="meters", extra_attributes={}, resolutions={ @@ -316,9 +308,7 @@ class GMTRemoteDataset(NamedTuple): }, ), "venus_relief": GMTRemoteDataset( - title="Venus relief", - name="venus_relief", - long_name="NASA Magellan Venus relief", + description="NASA Magellan Venus relief", units="meters", extra_attributes={}, resolutions={ @@ -388,7 +378,7 @@ def _load_remote_dataset( # Check resolution if resolution not in dataset.resolutions: raise GMTInvalidInput( - f"Invalid resolution '{resolution}' for {dataset.title} dataset. " + f"Invalid resolution '{resolution}' for {dataset.description} dataset. " f"Available resolutions are: {', '.join(dataset.resolutions)}." ) resinfo = dataset.resolutions[resolution] @@ -401,7 +391,7 @@ def _load_remote_dataset( if registration not in resinfo.registrations: raise GMTInvalidInput( f"{registration} registration is not available for the " - f"{resolution} {dataset.title} dataset. Only " + f"{resolution} {dataset.description} dataset. Only " f"{resinfo.registrations[0]} registration is available." ) else: @@ -414,7 +404,7 @@ def _load_remote_dataset( fname = f"@{dataset_prefix}{resolution}_{registration[0]}" if resinfo.tiled and region is None: raise GMTInvalidInput( - f"'region' is required for {dataset.title} resolution '{resolution}'." + f"'region' is required for {dataset.description} resolution '{resolution}'." ) # Currently, only grids are supported. Will support images in the future. @@ -434,8 +424,7 @@ def _load_remote_dataset( grid.encoding["source"] = source # Add some metadata to the grid - grid.name = dataset.name - grid.attrs["long_name"] = dataset.long_name + grid.attrs["description"] = dataset.description if dataset.units: grid.attrs["units"] = dataset.units for key, value in dataset.extra_attributes.items(): diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index 04e4d21d848..3fbe933bc04 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -139,7 +139,7 @@ def grd2xyz( >>> # Create a pandas DataFrame with the xyz data from an input grid >>> xyz_dataframe = pygmt.grd2xyz(grid=grid, output_type="pandas") >>> xyz_dataframe.head(n=2) - lon lat elevation + lon lat z 0 10.0 25.0 965.5 1 10.5 25.0 876.5 """ diff --git a/pygmt/tests/test_datasets_earth_age.py b/pygmt/tests/test_datasets_earth_age.py index 854821bad25..67ade3dd3d9 100644 --- a/pygmt/tests/test_datasets_earth_age.py +++ b/pygmt/tests/test_datasets_earth_age.py @@ -12,9 +12,10 @@ def test_earth_age_01d(): Test some properties of the earth age 01d data. """ data = load_earth_age(resolution="01d") - assert data.name == "seafloor_age" + assert data.name == "z" + assert data.attrs["long_name"] == "ages (Myr)" + assert data.attrs["description"] == "EarthByte Earth seafloor crustal age" assert data.attrs["units"] == "Myr" - assert data.attrs["long_name"] == "age of seafloor crust" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) assert data.gmt.registration == 0 diff --git a/pygmt/tests/test_datasets_earth_free_air_anomaly.py b/pygmt/tests/test_datasets_earth_free_air_anomaly.py index 3bf3b32fa47..517a1bb9b89 100644 --- a/pygmt/tests/test_datasets_earth_free_air_anomaly.py +++ b/pygmt/tests/test_datasets_earth_free_air_anomaly.py @@ -12,8 +12,9 @@ def test_earth_faa_01d(): Test some properties of the free air anomaly 01d data. """ data = load_earth_free_air_anomaly(resolution="01d") - assert data.name == "free_air_anomaly" - assert data.attrs["long_name"] == "IGPP Earth Free-Air Anomaly" + assert data.name == "z" + assert data.attrs["long_name"] == "faa (mGal)" + assert data.attrs["description"] == "IGPP Earth free-air anomaly" assert data.attrs["units"] == "mGal" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) diff --git a/pygmt/tests/test_datasets_earth_geoid.py b/pygmt/tests/test_datasets_earth_geoid.py index 3ea2916792c..84bfc5d7bf4 100644 --- a/pygmt/tests/test_datasets_earth_geoid.py +++ b/pygmt/tests/test_datasets_earth_geoid.py @@ -12,9 +12,10 @@ def test_earth_geoid_01d(): Test some properties of the earth geoid 01d data. """ data = load_earth_geoid(resolution="01d") - assert data.name == "earth_geoid" + assert data.name == "z" + assert data.attrs["long_name"] == "geoid (m)" + assert data.attrs["description"] == "EGM2008 Earth geoid" assert data.attrs["units"] == "m" - assert data.attrs["long_name"] == "EGM2008 Earth Geoid" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) assert data.gmt.registration == 0 diff --git a/pygmt/tests/test_datasets_earth_magnetic_anomaly.py b/pygmt/tests/test_datasets_earth_magnetic_anomaly.py index aa81ad5e1a4..65e1a57601c 100644 --- a/pygmt/tests/test_datasets_earth_magnetic_anomaly.py +++ b/pygmt/tests/test_datasets_earth_magnetic_anomaly.py @@ -14,8 +14,9 @@ def test_earth_mag_01d(): Test some properties of the magnetic anomaly 01d data. """ data = load_earth_magnetic_anomaly(resolution="01d") - assert data.name == "magnetic_anomaly" - assert data.attrs["long_name"] == "Earth magnetic anomaly" + assert data.name == "z" + assert data.attrs["long_name"] == "anomaly (nT)" + assert data.attrs["description"] == "EMAG2 Earth Magnetic Anomaly Model" assert data.attrs["units"] == "nT" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) @@ -60,8 +61,9 @@ def test_earth_mag4km_01d(): Test some properties of the magnetic anomaly 4km 01d data. """ data = load_earth_magnetic_anomaly(resolution="01d", data_source="emag2_4km") - assert data.name == "magnetic_anomaly" - assert data.attrs["long_name"] == "Earth magnetic anomaly" + assert data.name == "z" + assert data.attrs["long_name"] == "anomaly (nT)" + assert data.attrs["description"] == "EMAG2 Earth Magnetic Anomaly Model" assert data.attrs["units"] == "nT" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) @@ -116,8 +118,9 @@ def test_earth_mag_01d_wdmam(): data = load_earth_magnetic_anomaly( resolution="01d", registration="gridline", data_source="wdmam" ) - assert data.name == "wdmam" - assert data.attrs["long_name"] == "World Digital Magnetic Anomaly Map" + assert data.name == "z" + assert data.attrs["long_name"] == "anomaly (nT)" + assert data.attrs["description"] == "WDMAM World Digital Magnetic Anomaly Map" assert data.attrs["units"] == "nT" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) diff --git a/pygmt/tests/test_datasets_earth_mask.py b/pygmt/tests/test_datasets_earth_mask.py index d46bfd3353f..c449e1a79a7 100644 --- a/pygmt/tests/test_datasets_earth_mask.py +++ b/pygmt/tests/test_datasets_earth_mask.py @@ -12,8 +12,8 @@ def test_earth_mask_01d(): Test some properties of the Earth mask 01d data. """ data = load_earth_mask(resolution="01d") - assert data.name == "earth_mask" - assert data.attrs["long_name"] == "Mask of land and water features" + assert data.name == "z" + assert data.attrs["description"] == "GSHHG Earth mask" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) assert data.gmt.registration == 0 diff --git a/pygmt/tests/test_datasets_earth_relief.py b/pygmt/tests/test_datasets_earth_relief.py index 13339ab0bb8..48ce69996ba 100644 --- a/pygmt/tests/test_datasets_earth_relief.py +++ b/pygmt/tests/test_datasets_earth_relief.py @@ -18,13 +18,14 @@ def test_earth_relief_01d_igpp_synbath(data_source): Test some properties of the earth relief 01d data with IGPP and SYNBATH data. """ data = load_earth_relief(resolution="01d", data_source=data_source) - assert data.name == "elevation" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "IGPP Earth relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "Earth elevation relative to the geoid" assert data.attrs["vertical_datum"] == "EGM96" assert data.attrs["horizontal_datum"] == "WGS84" - assert data.gmt.registration == 0 assert data.shape == (181, 361) + assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1)) npt.assert_allclose(data.lon, np.arange(-180, 181, 1)) npt.assert_allclose(data.min(), -7174.0, atol=0.5) @@ -37,8 +38,10 @@ def test_earth_relief_01d_gebco(data_source): Test some properties of the earth relief 01d data with GEBCO and GEBOCSI data. """ data = load_earth_relief(resolution="01d", data_source=data_source) + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "GEBCO Earth relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "Earth elevation relative to the geoid" assert data.attrs["vertical_datum"] == "EGM96" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) diff --git a/pygmt/tests/test_datasets_earth_vertical_gravity_gradient.py b/pygmt/tests/test_datasets_earth_vertical_gravity_gradient.py index 7e1ab6a2c88..84fda47f8f7 100644 --- a/pygmt/tests/test_datasets_earth_vertical_gravity_gradient.py +++ b/pygmt/tests/test_datasets_earth_vertical_gravity_gradient.py @@ -12,9 +12,10 @@ def test_earth_vertical_gravity_gradient_01d(): Test some properties of the earth vgg 01d data. """ data = load_earth_vertical_gravity_gradient(resolution="01d") - assert data.name == "earth_vgg" + assert data.name == "z" + assert data.attrs["long_name"] == "vgg (Eotvos)" + assert data.attrs["description"] == "IGPP Earth vertical gravity gradient" assert data.attrs["units"] == "Eotvos" - assert data.attrs["long_name"] == "IGPP Earth Vertical Gravity Gradient" assert data.attrs["horizontal_datum"] == "WGS84" assert data.shape == (181, 361) assert data.gmt.registration == 0 diff --git a/pygmt/tests/test_datasets_load_remote_datasets.py b/pygmt/tests/test_datasets_load_remote_datasets.py index 0b9c3f55dde..ac28a594813 100644 --- a/pygmt/tests/test_datasets_load_remote_datasets.py +++ b/pygmt/tests/test_datasets_load_remote_datasets.py @@ -26,8 +26,8 @@ def test_load_remote_dataset_benchmark_with_region(): Benchmark loading a remote dataset with 'region'. """ data = load_remote_dataset_wrapper(resolution="01d", region=[-10, 10, -5, 5]) - assert data.name == "seafloor_age" - assert data.attrs["long_name"] == "age of seafloor crust" + assert data.name == "z" + assert data.attrs["long_name"] == "ages (Myr)" assert data.attrs["units"] == "Myr" assert data.attrs["horizontal_datum"] == "WGS84" assert data.gmt.registration == 0 diff --git a/pygmt/tests/test_datasets_mars_relief.py b/pygmt/tests/test_datasets_mars_relief.py index 7a8ed0993b1..88c437848f6 100644 --- a/pygmt/tests/test_datasets_mars_relief.py +++ b/pygmt/tests/test_datasets_mars_relief.py @@ -12,9 +12,10 @@ def test_mars_relief_01d(): Test some properties of the Mars relief 01d data. """ data = load_mars_relief(resolution="01d") - assert data.name == "mars_relief" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "NASA Mars (MOLA) relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "NASA Mars (MOLA) relief" assert data.shape == (181, 361) assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1)) diff --git a/pygmt/tests/test_datasets_mercury_relief.py b/pygmt/tests/test_datasets_mercury_relief.py index e51ef7c0dc1..65dbe62e0d1 100644 --- a/pygmt/tests/test_datasets_mercury_relief.py +++ b/pygmt/tests/test_datasets_mercury_relief.py @@ -12,9 +12,10 @@ def test_mercury_relief_01d(): Test some properties of the Mercury relief 01d data. """ data = load_mercury_relief(resolution="01d") - assert data.name == "mercury_relief" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "USGS Mercury relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "USGS Mercury relief" assert data.shape == (181, 361) assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1)) diff --git a/pygmt/tests/test_datasets_moon_relief.py b/pygmt/tests/test_datasets_moon_relief.py index 5aa801d792d..87f10ded098 100644 --- a/pygmt/tests/test_datasets_moon_relief.py +++ b/pygmt/tests/test_datasets_moon_relief.py @@ -12,9 +12,10 @@ def test_moon_relief_01d(): Test some properties of the Moon relief 01d data. """ data = load_moon_relief(resolution="01d") - assert data.name == "moon_relief" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "USGS Moon (LOLA) relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "USGS Moon (LOLA) relief" assert data.shape == (181, 361) assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1)) diff --git a/pygmt/tests/test_datasets_pluto_relief.py b/pygmt/tests/test_datasets_pluto_relief.py index ad5a046d528..9979f5915a5 100644 --- a/pygmt/tests/test_datasets_pluto_relief.py +++ b/pygmt/tests/test_datasets_pluto_relief.py @@ -12,9 +12,10 @@ def test_pluto_relief_01d(): Test some properties of the Pluto relief 01d data. """ data = load_pluto_relief(resolution="01d") - assert data.name == "pluto_relief" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "USGS Pluto relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "USGS Pluto relief" assert data.shape == (181, 361) assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1)) diff --git a/pygmt/tests/test_datasets_venus_relief.py b/pygmt/tests/test_datasets_venus_relief.py index f411ff2069c..f2dc9a9489f 100644 --- a/pygmt/tests/test_datasets_venus_relief.py +++ b/pygmt/tests/test_datasets_venus_relief.py @@ -12,9 +12,10 @@ def test_venus_relief_01d(): Test some properties of the Venus relief 01d data. """ data = load_venus_relief(resolution="01d") - assert data.name == "venus_relief" + assert data.name == "z" + assert data.attrs["long_name"] == "elevation (m)" + assert data.attrs["description"] == "NASA Magellan Venus relief" assert data.attrs["units"] == "meters" - assert data.attrs["long_name"] == "NASA Magellan Venus relief" assert data.shape == (181, 361) assert data.gmt.registration == 0 npt.assert_allclose(data.lat, np.arange(-90, 91, 1))