argopy.TopoFetcher

argopy.TopoFetcher

class TopoFetcher(box: list, ds: str = 'gebco', cache: bool = False, cachedir: str = '', api_timeout: int = 0, stride: list = [1, 1], **kwargs)[source]

Fetch topographic data through an ERDDAP server for an ocean rectangle

Example

>>> from argopy import TopoFetcher
>>> box = [-75, -45, 20, 30]  # Lon_min, lon_max, lat_min, lat_max
>>> ds = TopoFetcher(box).to_xarray()
>>> ds = TopoFetcher(box, ds='gebco', stride=[10, 10], cache=True).to_xarray()
__init__(box: list, ds: str = 'gebco', cache: bool = False, cachedir: str = '', api_timeout: int = 0, stride: list = [1, 1], **kwargs)[source]

Instantiate an ERDDAP topo data fetcher

Parameters
  • ds (str (optional), default: 'gebco') –

    Dataset to load:

    • ’gebco’ will load the GEBCO_2020 Grid, a continuous terrain model for oceans and land at 15 arc-second intervals

  • stride (list, default [1, 1]) – Strides along longitude and latitude. This allows to change the output resolution

  • cache (bool (optional)) – Cache data or not (default: False)

  • cachedir (str (optional)) – Path to cache folder

  • api_timeout (int (optional)) – Erddap request time out in seconds. Set to OPTIONS[‘api_timeout’] by default.

Methods

__init__(box[, ds, cache, cachedir, ...])

Instantiate an ERDDAP topo data fetcher

cname()

Return a unique string defining the constraints

define_constraints()

Define request constraints

get_url()

Return the URL to download data requested

load([errors])

Load Topographic data and return a xarray.DataSet

to_xarray([errors])

Load Topographic data and return a xarray.DataSet

Attributes

cachepath

Return path to cached file(s) for this request

uri

List of files to load for a request