API reference

This page provides an auto-generated summary of argopy’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.

Top-levels functions

argopy.DataFetcher

alias of argopy.fetchers.ArgoDataFetcher

argopy.IndexFetcher

alias of argopy.fetchers.ArgoIndexFetcher

Fetching entries

argopy.DataFetcher.region(box)

Space/time domain data fetcher

argopy.DataFetcher.float(wmo, **kw)

Float data fetcher

argopy.DataFetcher.profile(wmo, cyc)

Specific profile data fetcher

argopy.IndexFetcher.region(box)

Load index for a rectangular space/time domain region

argopy.IndexFetcher.float(wmo)

Load index for one or more WMOs

I/O and Data formats

argopy.DataFetcher.to_xarray(**kwargs)

Fetch and return data as xarray.DataSet

argopy.DataFetcher.to_dataframe(**kwargs)

Fetch and return data as pandas.Dataframe

argopy.IndexFetcher.to_xarray(**kwargs)

Fetch index and return xr.dataset

argopy.IndexFetcher.to_dataframe(**kwargs)

Fetch index and return pandas.Dataframe

argopy.IndexFetcher.to_csv([file])

Fetch index and return csv

Visualisation

argopy.IndexFetcher.plot([ptype])

Create custom plots from index

argopy.dashboard([wmo, cyc, width, height, …])

Insert in a notebook the Euro-Argo dashboard page

Fetcher properties

argopy.DataFetcher.uri

List of resources to load for a request

Helpers

argopy.set_options(**kwargs)

Set options for argopy.

argopy.clear_cache()

Delete argopy cache folder content

argopy.tutorial.open_dataset(name)

Open a dataset from the argopy online data repository (requires internet).

Low-level functions

argopy.show_versions([file])

Print the versions of argopy and its dependencies

argopy.utilities.list_available_data_src()

List all available data sources

argopy.utilities.list_available_index_src()

List all available index sources

Internals

File systems

argopy.stores.filestore(cache, cachedir, …)

Argo local file system

argopy.stores.httpstore(cache, cachedir, …)

Argo http file system

argopy.stores.memorystore(cache, cachedir, …)

Argo in-memory file system

argopy.stores.indexstore(cache, cachedir, …)

Use to manage access to a local Argo index and searches

argopy.stores.indexfilter_wmo(WMO[, CYC])

Index filter based on WMO and/or CYCLE_NUMER

argopy.stores.indexfilter_box(BOX, **kwargs)

Index filter based on LATITUDE, LONGITUDE, DATE

Fetchers

ERDDAP

argopy.data_fetchers.erddap_data.ErddapArgoDataFetcher(ds, …)

Manage access to Argo data through Ifremer ERDDAP

argopy.data_fetchers.erddap_data.Fetch_wmo(ds, …)

Manage access to Argo data through Ifremer ERDDAP for: a list of WMOs

argopy.data_fetchers.erddap_data.Fetch_box(ds, …)

Manage access to Argo data through Ifremer ERDDAP for: an ocean rectangle

Local FTP

argopy.data_fetchers.localftp_data.LocalFTPArgoDataFetcher(…)

Manage access to Argo data from a local copy of GDAC ftp

argopy.data_fetchers.localftp_data.Fetch_wmo(…)

Manage access to local ftp Argo data for: a list of WMOs

argopy.data_fetchers.localftp_data.Fetch_box(…)

Manage access to local ftp Argo data for: a rectangular space/time domain

Xarray argo name space

class ArgoAccessor[source]

Class registered under scope argo to access a xarray.Dataset object.

  • Ensure all variables are of the Argo required dtype with:

    ds.argo.cast_types()

  • Convert a collection of points into a collection of profiles:

    ds.argo.point2profile()

  • Convert a collection of profiles to a collection of points:

    ds.argo.profile2point()

cast_types()[source]

Make sure variables are of the appropriate types

This is hard coded, but should be retrieved from an API somewhere Should be able to handle all possible variables encountered in the Argo dataset

filter_data_mode(keep_error: bool = True, errors: str = 'raise')[source]

Filter variables according to their data mode

This applies to <PARAM> and <PARAM_QC>

For data mode ‘R’ and ‘A’: keep <PARAM> (eg: ‘PRES’, ‘TEMP’ and ‘PSAL’) For data mode ‘D’: keep <PARAM_ADJUSTED> (eg: ‘PRES_ADJUSTED’, ‘TEMP_ADJUSTED’ and ‘PSAL_ADJUSTED’)

Parameters
keep_error: bool, optional

If true (default) keep the measurements error fields or not.

errors: {‘raise’,’ignore’}, optional

If ‘raise’ (default), raises a InvalidDatasetStructure error if any of the expected dataset variables is not found. If ‘ignore’, fails silently and return unmodified dataset.

Returns
xarray.Dataset
filter_qc(QC_list=[1, 2], drop=True, mode='all', mask=False)[source]

Filter data set according to QC values

Mask the dataset for points where ‘all’ or ‘any’ of the QC fields has a value in the list of integer QC flags.

This method can return the filtered dataset or the filter mask.

interp_std_levels(std_lev)[source]

Returns a new dataset interpolated to new inputs levels

Parameters
list or np.array

Standard levels used for interpolation

Returns
xarray.Dataset
point2profile()[source]

Transform a collection of points into a collection of profiles

profile2point()[source]

Convert a collection of profiles to a collection of points

teos10(vlist: list = ['SA', 'CT', 'SIG0', 'N2', 'PV', 'PTEMP'], inplace: bool = True)[source]

Add TEOS10 variables to the dataset

By default, adds: ‘SA’, ‘CT’, ‘SIG0’, ‘N2’, ‘PV’, ‘PTEMP’ Relies on the gsw library.

If one exists, the correct CF standard name will be added to the attrs.

Parameters
vlist: list(str)

List with the name of variables to add. Must be a list containing one or more of the following string values:

  • “SA”

    Adds an absolute salinity variable

  • “CT”

    Adds a conservative temperature variable

  • “SIG0”

    Adds a potential density anomaly variable referenced to 0 dbar

  • “N2”

    Adds a buoyancy (Brunt-Vaisala) frequency squared variable. This variable has been regridded to the original pressure levels in the Dataset using a linear interpolation.

  • “PV”

    Adds a planetary vorticity variable calculated from \(\frac{f N^2}{\text{gravity}}\). This is not a TEOS-10 variable from the gsw toolbox, but is provided for convenience. This variable has been regridded to the original pressure levels in the Dataset using a linear interpolation.

  • “PTEMP”

    Adds a potential temperature variable

inplace: boolean, True by default

If True, return the input xarray.Dataset with new TEOS10 variables added as a new xarray.DataArray If False, return a xarray.Dataset with new TEOS10 variables

Returns
xarray.Dataset
uid(wmo_or_uid, cyc=None, direction=None)[source]

UID encoder/decoder

Parameters
int

WMO number (to encode) or UID (to decode)

cyc: int, optional

Cycle number (to encode), not used to decode

direction: str, optional

Direction of the profile, must be ‘A’ (Ascending) or ‘D’ (Descending)

Returns
int or tuple of int

Examples

unique_float_profile_id = uid(690024,13,’A’) # Encode wmo, cyc, drc = uid(unique_float_profile_id) # Decode