argopy.ArgoFloat

argopy.ArgoFloat#

class ArgoFloat(*args, **kwargs)[source]#

Argo GDAC float store

This store makes it easy to load/read data for a given float from any GDAC location and netcdf files

Examples

Listing 14 A float store is instantiated with float WMO number and a host (any access path: local, http, ftp or s3) where float files are to be found.#
from argopy import ArgoFloat
af = ArgoFloat(WMO)  # Use argopy 'gdac' option by default
af = ArgoFloat(WMO, host='/home/ref-argo/gdac')  # Use your local GDAC copy
af = ArgoFloat(WMO, host='http')   # Shortcut for https://data-argo.ifremer.fr
af = ArgoFloat(WMO, host='ftp')    # shortcut for ftp://ftp.ifremer.fr/ifremer/argo
af = ArgoFloat(WMO, host='s3')     # Shortcut for s3://argo-gdac-sandbox/pub
Listing 15 Load/read GDAC netcdf files as a xarray.Dataset#
af.ls_dataset() # Return a dictionary with all available datasets for this float
ds = af.open_dataset('prof') # Use keys from the available datasets dictionary
ds = af.open_dataset('meta')
ds = af.open_dataset('tech')
ds = af.open_dataset('Rtraj')
ds = af.open_dataset('Sprof')
Listing 16 Other attributes and methods#
af.N_CYCLES  # Number of cycles (estimated)
af.path  # root path for all float datasets
af.dac   # name of the DAC this float belongs to
af.metadata  # a dictionary with all available metadata for this file (from netcdf or fleetmonitoring API)
af.ls()  # list af.path folder content
Listing 17 Working with float profiles#
af.lsprofiles() # list float "profiles" folder content
af.describe_profiles()  # Pandas DataFrame describing all available float profile files
__init__(*args, **kwargs)[source]#

Create an Argo float store

Parameters:
  • wmo (int or str) – The float WMO number. It will be validated against the Argo convention and raise an ValueError if not compliant.

  • host (str, optional, default: OPTIONS['gdac']) –

    Local or remote (http, ftp or s3) path where a dac folder is to be found (compliant with GDAC structure).

    This parameter takes values like:

    • a local absolute path

    • https://data-argo.ifremer.fr, shortcut with http or https

    • https://usgodae.org/pub/outgoing/argo, shortcut with us-http or us-https

    • ftp://ftp.ifremer.fr/ifremer/argo, shortcut with ftp

    • s3://argo-gdac-sandbox/pub, shortcut with s3 or aws

  • aux (bool, default = False) – Should we include dataset from the auxiliary data folder. The ‘aux’ folder is expected to be at the same path level as the ‘dac’ folder on the GDAC host.

  • cache (bool, optional, default: False) – Use cache or not.

  • cachedir (str, optional, default: OPTIONS['cachedir']) – Folder where to store cached files.

  • timeout (int, optional, default: OPTIONS['api_timeout']) – Time out in seconds to connect to a remote host (ftp or http).

Methods

__init__(*args, **kwargs)

Create an Argo float store

describe_profiles()

Return a pandas.DataFrame describing profile files

load_dac()

Load the DAC short name for this float

load_index()

Load the Argo full index in memory and trigger search for this float

load_metadata()

Load float metadata from Euro-Argo fleet-monitoring API

load_metadata_from_meta_file()

Method to load float meta-data

load_technicaldata()

Load float technical data from Euro-Argo fleet-monitoring API

ls()

Return the list of files in float path

ls_dataset()

List all available dataset for this float in a dictionary

lsprofiles()

Return the list of files in float profiles path

open_dataset([name, cast])

Open and decode a dataset

Attributes

N_CYCLES

Number of cycles

api_point

Euro-Argo fleet-monitoring API points

dac

Name of the DAC responsible for this float

host_protocol

Protocol of the GDAC host

host_sep

Host path separator

metadata

A dictionary of float meta-data

path

Return root path for all float datasets

technicaldata

A dictionary holding float technical data