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.

Argo Data Fetchers#

Data selection methods#

DataFetcher.region()

Space/time domain data fetcher

DataFetcher.float()

Float data fetcher

DataFetcher.profile()

Profile data fetcher

Data access methods#

DataFetcher.load([force])

Fetch data (and compute a profile index) if not already in memory

DataFetcher.to_xarray(**kwargs)

Fetch and return data as xarray.DataSet

DataFetcher.to_dataframe(**kwargs)

Fetch and return data as pandas.DataFrame

DataFetcher.to_index([full, coriolis_id])

Return a profile index of Argo data, fetch data if necessary

DataFetcher.to_dataset(**kwargs)

Fetch and return data as netCDF4.Dataset

Data visualisation methods#

DataFetcher.plot([ptype])

Create custom plots from this fetcher data or index.

DataFetcher.dashboard(**kw)

Open access point dashboard.

IndexFetcher.plot([ptype])

Create custom plots from this fetcher index.

Properties#

DataFetcher.data

Data structure

DataFetcher.index

Index structure, as returned by the to_index method

DataFetcher.domain

Space/time domain of the dataset

DataFetcher.uri

List of resources to load for a request

Dataset.argo (xarray accessor to work with Argo dataset)#

Dataset.argo

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

This accessor extends xarray.Dataset. Proper use of this accessor should be like:

>>> import xarray as xr         # first import xarray
>>> import argopy               # import argopy (the dataset 'argo' accessor is then registered)
>>> from argopy import DataFetcher
>>> ds = DataFetcher().float([6902766, 6902772, 6902914, 6902746]).load().data
>>> ds.argo
>>> ds.argo.filter_qc()

Data Transformation#

Dataset.argo.point2profile([drop])

Transform a collection of points into a collection of profiles

Dataset.argo.profile2point()

Transform a collection of profiles to a collection of points

Dataset.argo.interp_std_levels(std_lev[, axis])

Interpolate measurements to standard pressure levels

Dataset.argo.groupby_pressure_bins(bins[, ...])

Group measurements by pressure bins

Dataset.argo.datamode.compute(indexfs)

Compute <PARAM>_DATA_MODE variables

Dataset.argo.datamode.filter([dm, params, ...])

Filter measurements according to parameters data mode

Dataset.argo.datamode.merge([params, errors])

Merge <PARAM> and <PARAM>_ADJUSTED variables according to DATA_MODE or <PARAM>_DATA_MODE

Dataset.argo.datamode.split()

Convert PARAMETER_DATA_MODE(N_PROF, N_PARAM) into several <PARAM>_DATA_MODE(N_PROF) variables

Data Filters#

Dataset.argo.filter_qc([QC_list, QC_fields, ...])

Filter measurements according to QC values

Dataset.argo.filter_scalib_pres([force, inplace])

Filter variables according to OWC salinity calibration software requirements

Dataset.argo.filter_researchmode()

Filter dataset for research user mode

Dataset.argo.datamode.filter([dm, params, ...])

Filter measurements according to parameters data mode

Extensions#

You can create your own extension to an Argo dataset for specific features. It should be registered by inheriting from argopy.extensions.ArgoAccessorExtension and decorated with argopy.extensions.register_argo_accessor.

argopy comes with the following extensions:

General purposes#

Dataset.argo.teos10([vlist, inplace])

Add TEOS10 variables to the dataset

Dataset.argo.datamode(**kwargs)

Utilities for Argo parameters data mode

Dataset.argo.create_float_source([path, ...])

Preprocess data for OWC software calibration

BGC specifics#

Dataset.argo.canyon_med(**kwargs)

Nutrients and Carbonate System Variables predictor with CANYON-MED

Dataset.argo.canyon_med.predict([params])

Make predictions using the CANYON-MED neural network

Dataset.argo.canyon_med.input_list

List of parameters required to make predictions with CANYON-MED

Dataset.argo.canyon_med.output_list

List of all possible output variables for CANYON-MED

Dataset.argo.canyon_b(**kwargs)

Nutrients and Carbonate System Variables predictor with CANYON-B

Dataset.argo.canyon_b.predict([params, ...])

Make predictions using the CANYON-B method.

Dataset.argo.canyon_b.input_list

List of parameters required to make predictions with CANYON-B

Dataset.argo.canyon_b.output_list

List of all possible output variables for CANYON-B

Dataset.argo.content(**kwargs)

Nutrients and Carbonate System Variables predictor made consistent with chemistry constraints with CONTENT

Dataset.argo.content.predict([epres, etemp, ...])

Make predictions using the CONTENT method.

Dataset.argo.content.input_list

List of parameters required to make predictions with CONTENT

Dataset.argo.content.output_list

List of all possible output variables for CONTENT

Dataset.argo.optic(**kwargs)

Optical modeling of the upper ocean

Dataset.argo.optic.Zeu([axis, par, method, ...])

Depth of the euphotic zone from PAR

Dataset.argo.optic.Zpd(*args, **kwargs)

First optical depth from depth of the euphotic zone

Dataset.argo.optic.Z_iPAR_threshold([axis, ...])

Depth where PAR reaches some threshold value (closest point)

Dataset.argo.optic.DCM([axis, chla, bbp, ...])

Search and qualify Deep Chlorophyll Maxima

Misc#

Dataset.argo.index

Basic profile index

Dataset.argo.domain

Space/time domain of the dataset

Dataset.argo.list_WMO_CYC

Return a tuple with all (PLATFORM_NUMBER, CYCLE_NUMBER) in the dataset

Dataset.argo.uid(wmo_or_uid[, cyc, direction])

UID encoder/decoder

Dataset.argo.cast_types(**kwargs)

Make sure variables are of the appropriate types according to Argo

Dataset.argo.N_POINTS

Number of measurement points

Dataset.argo.to_zarr(*args, **kwargs)

Write Argo dataset content to a zarr group

Dataset.argo.reduce_profile(func[, params])

Apply a vectorized function for unlabeled arrays for each Argo profiles

ArgoFloat (data and meta-data fetcher for one float)#

ArgoFloat(*args, **kwargs)

Argo GDAC float store

Extension: Plot

ArgoFloat.plot

Extension providing plot methods

ArgoFloat.plot.trajectory(**kwargs)

Quick map of the float trajectory

ArgoFloat.plot.map(param[, ds, pres, ...])

Plot a map of one dataset parameter, possibly sliced at a given pressure value.

ArgoFloat.plot.scatter(param[, ds])

Scatter plot for a 2-dimensional dataset parameter

Extension: Configuration and launch configuration parameters

ArgoFloat.config

Extension providing access to configuration parameters

ArgoFloat.config.n_params

Total number of parameters

ArgoFloat.config.parameters

List of configuration parameter names

ArgoFloat.config.n_missions

Total number of missions

ArgoFloat.config.missions

List of mission numbers

ArgoFloat.config.cycles

A dictionary mapping cycle on mission numbers

ArgoFloat.config.for_cycles(param, cycle_numbers)

Retrieve a configuration parameter for cycle number(s)

ArgoFloat.config.to_dataframe([missions])

Export configuration parameters to a class:pandas.DataFrame

ArgoFloat.launchconfig

Extension providing access to LAUNCH configuration parameters

ArgoFloat.launchconfig.n_params

Total number of parameters

ArgoFloat.launchconfig.parameters

List of configuration parameter names

ArgoFloat.launchconfig.to_dataframe()

Export launch configuration parameters to a class:pandas.DataFrame

ArgoIndex (explore Argo files index)#

ArgoIndex(**kwargs)

Argo GDAC index store

List of extensions:

ArgoIndex.query

Extension providing search methods to query index entries

ArgoIndex.plot

Extension providing plot methods

Search on a single property of a file record:

ArgoIndex.query.wmo(WMOs[, nrows, composed])

Search index for floats defined by WMO

ArgoIndex.query.cyc(CYCs[, nrows, composed])

Search index for cycle numbers

ArgoIndex.query.lon([BOX, nrows, composed])

Search index for a meridional band

ArgoIndex.query.lat([BOX, nrows, composed])

Search index for a zonal band

ArgoIndex.query.date([BOX, nrows, composed])

Search index for a date range

ArgoIndex.query.params(PARAMs[, logical, ...])

Search index for one or a list of parameters

ArgoIndex.query.parameter_data_mode(PARAMs)

Search index for profiles with a parameter in a specific data mode

ArgoIndex.query.profiler_type(profiler_type)

Search index for profiler types

ArgoIndex.query.profiler_label(profiler_label)

Search index for profiler types with a given string in their long name

ArgoIndex.query.institution_code(...[, ...])

Search index for institution codes

ArgoIndex.query.institution_name(...[, ...])

Search index for institutions with a given string in their long name

ArgoIndex.query.dac(dac[, nrows, composed])

Search index for DAC

Search on at least two properties of a file record:

ArgoIndex.query.wmo_cyc(WMOs, CYCs[, nrows, ...])

Search index for floats defined by their WMO and specific cycle numbers

ArgoIndex.query.lon_lat(BOX[, nrows, composed])

Search index for a rectangular longitude/latitude domain

ArgoIndex.query.box(BOX[, nrows, composed])

Search index for a box: a rectangular latitude/longitude domain and time range

ArgoIndex.query.compose(query[, nrows])

Compose query with multiple search methods

Plotting methods:

ArgoIndex.plot.trajectory([index])

Quick map of profile index trajectories

ArgoIndex.plot.bar([by, index])

Bar plot of one index property

Argo vocabulary: referencing system#

ArgoReferenceValue(name[, reference])

A class to work with an Argo Reference Value, i.e. a NVS vocabulary "concept".

ArgoReferenceTable([identifier])

A class to work with an Argo reference table, i.e. a NVS "vocabulary".

ArgoReferenceMapping(sub, obj, **kwargs)

A class to work with Argo Reference Value Relationships, i.e. a NVS "mapping".

GDAC file stores#

gdacfs([path, cache, cachedir])

Argo file system for any GDAC path

Data visualisation#

Visualisation functions available at the argopy module level:

dashboard([wmo, cyc, type, url_only, width, ...])

Insert an Argo dashboard page in a notebook cell, or return the corresponding url

ArgoColors([name, N])

Class to manage discrete coloring for Argo related variables

All other visualisation functions are in the argopy.plot submodule:

open_sat_altim_report([WMO, embed])

Insert the CLS Satellite Altimeter Report figure in notebook cell

scatter_map(data[, x, y, hue, markersize, ...])

Try-to-be generic function to create a scatter plot on a map from argopy xarray.Dataset or pandas.DataFrame data

bar_plot(df[, by, style, with_seaborn])

Create a bar plot for an Argo index dataframe

scatter_plot(ds, param[, x, y, figsize, ...])

Argo parameter scatter plot

latlongrid(ax[, dx, dy, fontsize, ...])

Add latitude/longitude grid line and labels to a cartopy geoaxes

Utilities#

Function under the argopy.utils submodule.

Lists#

list_available_data_src()

List all available data sources

list_available_index_src()

List all available index sources

list_standard_variables([ds])

List of dataset variables possibly return in standard user mode

list_multiprofile_file_variables()

List of all 🟡 core + 🔵 deep variables that can be found in a multi-profile netcdf file

list_core_parameters()

List of all 🟡 core + 🔵 deep parameters that can be found in mono and multi-profile netcdf files

list_bgc_s_variables()

List of all 🟢 BGC mission variables that can be found in a BGC Synthetic netcdf files

list_bgc_s_parameters()

List of all 🟢 BGC mission parameters that can be found in a BGC Synthetic netcdf files

list_radiometry_variables()

List of all 🟢 BGC mission variables related to radiometry that can be found in a BGC Synthetic netcdf files

list_radiometry_parameters()

List of all 🟢 BGC mission parameters related to radiometry that can be found in a BGC Synthetic netcdf files

list_gdac_servers()

List of official Argo GDAC servers

Checkers#

check_wmo(lst[, errors])

Validate a WMO option and returned it as a list of integers

check_cyc(lst[, errors])

Validate a CYC option and returned it as a list of integers

check_gdac_path(path[, errors, ignore_knowns])

Check if a path has the expected GDAC structure

isconnected([host, maxtry])

Check if an URL is alive

urlhaskeyword([url, keyword, maxtry])

Check if a keyword is in the content of a URL

isalive([api_server_check])

Check if an API is alive or not

isAPIconnected([src, data])

Check if a source API is alive or not

Misc#

float_wmo(WMO_number[, errors])

Argo float WMO number object

Registry([initlist, dtype, invalid])

A list manager that can validate item type

Chunker(request[, chunks, chunksize])

To chunk fetcher requests

drop_variables_not_in_all_datasets(ds_collection)

Drop variables that are not in all datasets (the lowest common denominator)

fill_variables_not_in_all_datasets(ds_collection)

Add empty variables to dataset so that all the collection have the same xarray.Dataset.data_vars and xarray.Dataset.coords

GreenCoding()

GreenCoding API helper class for argopy carbon footprint

Github([repo, owner])

Github repository helper class

optical_modeling

Utility module for optical modeling diagnostics.

Argopy helpers#

set_options(**kwargs)

Set options for argopy

clear_cache([fs])

Delete argopy cache folder content

tutorial.open_dataset(name)

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

show_versions([file, conda])

Print the versions of argopy and its dependencies

xarray.ArgoEngine()

Backend for Argo netCDF files based on the xarray netCDF4 engine

Internals#

File systems#

gdacfs([path, cache, cachedir])

Argo file system for any GDAC path

stores.ArgoStoreProto([cache, cachedir])

Argo File System Prototype

stores.filestore([cache, cachedir])

Argo local file system

stores.httpstore(*args, **kwargs)

Argo http file system

stores.httpstore_erddap([url, cache, cachedir])

Argo http file system that automatically try to login to an Erddap server

stores.memorystore([cache, cachedir])

Argo in-memory file system (global)

stores.ftpstore(*args, **kwargs)

Argo ftp file system

stores.s3store(*args, **kwargs)

Argo s3 file system

stores.ArgoKerchunker([store, root, ...])

Argo netcdf file kerchunk helper

Fetcher sources#

ERDDAP#

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

Manage access to Argo data through Ifremer ERDDAP

data_fetchers.erddap_data.Fetch_wmo([ds, ...])

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

data_fetchers.erddap_data.Fetch_box([ds, ...])

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

GDAC#

data_fetchers.gdac_data.GDACArgoDataFetcher([...])

Manage access to Argo data from a GDAC server

data_fetchers.gdac_data.Fetch_wmo([ds, ...])

Manage access to GDAC Argo data for: a list of WMOs.

data_fetchers.gdac_data.Fetch_box([ds, ...])

Manage access to GDAC Argo data for: a rectangular space/time domain.

Argovis#