Skip to content

load_earth_relief fails with gebco 03s/01s datasets #4177

Description

@FilLTP89

Description of the problem

I compile gmt from source, within a docker file:

git clone https://github.com/GenericMappingTools/gmt.git
cd gmt && mkdir build && cd build &&
cmake -G Ninja .. && cmake --build . --target install

and install pygmt with pip install pygmt[all]

I cannot download earth relief from gebco (resolution 03s). I defined a local cache directory to be able to run on docker:

ENV GMT_USERDIR=/gmt_cache

But my feeling is that GEBCO Data are not available on the standard gmt servers.

Full script that generated the error

topography=pygmt.datasets.load_earth_relief(region=(20.2,20.9,38.0,38.54),data_source="gebc\
o",use_srtm=False,resolution="03s")

Full error message

Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    topography=pygmt.datasets.load_earth_relief(region=(20.2,20.9,38.0,38.54),data_source="gebco",use_srtm=False,resolution="03s")
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/datasets/earth_relief.py", line 180, in load_earth_relief
    grid = _load_remote_dataset(
        name=name,
    ...<3 lines>...
        registration=registration,
    )
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/datasets/load_remote_dataset.py", line 582, in _load_remote_dataset
    grid = xr.load_dataarray(
        fname, engine="gmt", raster_kind=dataset.kind, region=region
    )
  File "/app/easyrisk/lib/python3.13/site-packages/xarray/backends/api.py", line 190, in load_dataarray
    with open_dataarray(filename_or_obj, **kwargs) as da:
         ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/easyrisk/lib/python3.13/site-packages/xarray/backends/api.py", line 803, in open_dataarray
    dataset = open_dataset(
        filename_or_obj,
    ...<16 lines>...
        **kwargs,
    )
  File "/app/easyrisk/lib/python3.13/site-packages/xarray/backends/api.py", line 596, in open_dataset
    backend_ds = backend.open_dataset(
        filename_or_obj,
    ...<2 lines>...
        **kwargs,
    )
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/helpers/decorators.py", line 742, in new_module
    return module_func(*bound.args, **bound.kwargs)
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/xarray/backend.py", line 149, in open_dataset
    source: str | list = which(fname=filename_or_obj, verbose="quiet")
                         ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/helpers/decorators.py", line 576, in new_module
    return module_func(*args, **kwargs)
  File "/app/easyrisk/lib/python3.13/site-packages/pygmt/src/which.py", line 88, in which
    raise FileNotFoundError(msg)
FileNotFoundError: File(s) '@earth_gebco_03s_g' not found.```

**Actual outcome**


**Expected outcome**

I tried to downgrade to v 6.5.0 and i have the same problem.

**System information**
Pulling `debian:sid` from dockerhub.

* Operating system:
* GMT version (`gmt --version`): I tried the latest (v 6.7.0) and v. 6.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions