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

Fetchers

argopy.DataFetcher

alias of argopy.fetchers.ArgoDataFetcher

argopy.IndexFetcher

alias of argopy.fetchers.ArgoIndexFetcher

Fetcher access points

argopy.DataFetcher.region()

argopy.DataFetcher.float()

argopy.DataFetcher.profile()

argopy.IndexFetcher.region()

argopy.IndexFetcher.float()

Fetching methods

argopy.DataFetcher.load([force])

Load data in memory

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.DataFetcher.to_index([full])

Create an index of Argo data

argopy.IndexFetcher.load([force])

Load index in memory

argopy.IndexFetcher.to_xarray(**kwargs)

Fetch and return index data as xarray DataSet

argopy.IndexFetcher.to_dataframe(**kwargs)

Fetch and return index data as pandas Dataframe

argopy.IndexFetcher.to_csv([file])

Fetch and save index data as csv in a file

Fetched data visualisation

argopy.DataFetcher.plot([ptype])

Create custom plots from data

argopy.IndexFetcher.plot([ptype])

Create custom plots from index

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

Insert in a notebook cell the Euro-Argo dashboard page

Fetcher properties

argopy.DataFetcher.uri

List of resources to load for a request

argopy.DataFetcher.data

Data structure

argopy.DataFetcher.index

Index structure, as returned by the to_index method

argopy.IndexFetcher.index

Index structure

Helpers

argopy.status

alias of argopy.utilities.monitor_status

argopy.set_options(**kwargs)

Set options for argopy.

argopy.show_options([file])

Print options of argopy

argopy.show_versions([file])

Print the versions of argopy and its dependencies

argopy.clear_cache([fs])

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])

Index filter based on LATITUDE, LONGITUDE, DATE

Data Fetchers

ERDDAP

argopy.data_fetchers.erddap_data.ErddapArgoDataFetcher([...])

Manage access to Argo data through Ifremer ERDDAP

argopy.data_fetchers.erddap_data.Fetch_wmo([...])

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

argopy.data_fetchers.erddap_data.Fetch_box([...])

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

Argovis

argopy.data_fetchers.argovis_data.ArgovisDataFetcher([...])

argopy.data_fetchers.argovis_data.Fetch_wmo([...])

argopy.data_fetchers.argovis_data.Fetch_box([...])

Plotters

argopy.plotters.plot_trajectory(df[, style, ...])

Plot trajectories for an Argo index dataframe

argopy.plotters.bar_plot(df[, by, style, ...])

Create a bar plot for an Argo index dataframe

argopy.plotters.open_dashboard([wmo, cyc, ...])

Insert in a notebook cell the Euro-Argo dashboard page

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’ Other possible variables: ‘SIG0’, ‘N2’, ‘PV’, ‘PTEMP’, ‘SOUND_SPEED’ 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

  • “SOUND_SPEED”

    Adds a sound speed 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