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¶
alias of |
|
alias of |
Fetching entries¶
Space/time domain data fetcher |
|
|
Float data fetcher |
|
Specific profile data fetcher |
Load index for a rectangular space/time domain region |
|
Load index for one or more WMOs |
I/O and Data formats¶
|
Fetch and return data as xarray.DataSet |
|
Fetch and return data as pandas.Dataframe |
|
Fetch index and return xr.dataset |
|
Fetch index and return pandas.Dataframe |
|
Fetch index and return csv |
Visualisation¶
|
Create custom plots from index |
|
Insert in a notebook the Euro-Argo dashboard page |
Fetcher properties¶
List of resources to load for a request |
Helpers¶
|
Set options for argopy. |
Delete argopy cache folder content |
|
Open a dataset from the argopy online data repository (requires internet). |
Low-level functions¶
|
Print the versions of argopy and its dependencies |
List all available data sources |
|
List all available index sources |
Internals¶
File systems¶
|
Argo local file system |
|
Argo http file system |
|
Argo in-memory file system |
|
Use to manage access to a local Argo index and searches |
|
Index filter based on WMO and/or CYCLE_NUMER |
|
Index filter based on LATITUDE, LONGITUDE, DATE |
Fetchers¶
ERDDAP¶
|
Manage access to Argo data through Ifremer ERDDAP |
Manage access to Argo data through Ifremer ERDDAP for: a list of WMOs |
|
Manage access to Argo data through Ifremer ERDDAP for: an ocean rectangle |
Local FTP¶
|
Manage access to Argo data from a local copy of GDAC ftp |
Manage access to local ftp Argo data for: a list of WMOs |
|
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 axarray.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
-
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
-
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 newxarray.DataArray
If False, return axarray.Dataset
with new TEOS10 variables
- Returns
-
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