Skip to content

Instantly share code, notes, and snippets.

@gmaze
Last active September 28, 2022 12:07
Show Gist options
  • Save gmaze/6c686c2d00bf085b9f8874cc6c5fd99e to your computer and use it in GitHub Desktop.
Save gmaze/6c686c2d00bf085b9f8874cc6c5fd99e to your computer and use it in GitHub Desktop.

Import the library:

# Import the main fetcher:
from argopy import DataFetcher as ArgoDataFetcher

Define what you want to fetch:

# a region:
ArgoSet = ArgoDataFetcher().region([-85, -45, 10., 20., 0, 1000.])
ArgoSet = ArgoDataFetcher().region([-85, -45, 10., 20., 0, 4000.,'20220901','20221001'])

# floats:
ArgoSet = ArgoDataFetcher().float([6902746, 6902747, 6902757, 6902766])

# or specific profiles:
ArgoSet = ArgoDataFetcher().profile(6902746, 34)
ArgoSet = ArgoDataFetcher().profile(6902746, np.arange(1,10))

The ArgoSet provides basic information about the Data fetcher:

<datafetcher.erddap>
Name: Ifremer erddap Argo data fetcher for a space/time region
API: https://erddap.ifremer.fr/erddap/
Domain: [x=-85.00/-45.00; y=10.00/20.00; z=0.0/1000.0]
Performances: cache=False, parallel=False
User mode: standard
Dataset: phy

Then fetch and get data as xarray datasets:

ds = ArgoSet.load().data
# or
ds = ArgoSet.to_xarray()

Fetch data from many sources:

ArgoSet = ArgoDataFetcher(src='erddap')
ArgoSet = ArgoDataFetcher(src='gdac') # by default points to: https://data-argo.ifremer.fr
ArgoSet = ArgoDataFetcher(src='gdac', ftp="ftp://ftp.ifremer.fr/ifremer/argo") 
ArgoSet = ArgoDataFetcher(src='gdac', ftp='ftp://usgodae.org/pub/outgoing/argo')
ArgoSet = ArgoDataFetcher(src='gdac', ftp='/Users/gmaze/data/local_Argoftp_copy')
ArgoSet = ArgoDataFetcher(src='argovis')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment