Skip to main content

A python library for Argo data beginners and experts

Project description

argopy logo argopy is a python library that aims to ease Argo data access, visualisation and manipulation for regular users as well as Argo experts and operators
Documentation JOSS
Documentation
Gitter
Usage License Python version
pypi dwn conda dwn
Release PyPI Conda
Development Github Action Status Documentation Status codecov
lifecycle
Data resources Erddap status Argovis status
Profile count
Statuspage

Install

Install the last release with conda:

conda install -c conda-forge argopy

or pip:

pip install argopy

or conda:

conda install -c conda-forge argopy

But since this is a young library in active development, use direct install from this repo to benefit from the latest version:

pip install git+http://github.com/euroargodev/argopy.git@master

The argopy library is tested to work under most OS (Linux, Mac) and with python versions 3.7 and 3.8.

Usage

badge

Fetching Argo Data

Import the data fetcher:

from argopy import DataFetcher as ArgoDataFetcher

and then, set it up to request data for a specific space/time domain:

argo_loader = ArgoDataFetcher().region([-85,-45,10.,20.,0,10.])
argo_loader = ArgoDataFetcher().region([-85,-45,10.,20.,0,1000.,'2012-01','2012-12'])

for profiles of a given float:

argo_loader = ArgoDataFetcher().profile(6902746, 34)
argo_loader = ArgoDataFetcher().profile(6902746, np.arange(12,45))
argo_loader = ArgoDataFetcher().profile(6902746, [1,12])

or for one or a collection of floats:

argo_loader = ArgoDataFetcher().float(6902746)
argo_loader = ArgoDataFetcher().float([6902746, 6902747, 6902757, 6902766])

Once your fetcher is initialized you can trigger fetch/load data like this:

ds = argo_loader.to_xarray()  # or:
ds = argo_loader.load().data

By default fetched data are returned in memory as xarray.DataSet. From there, it is easy to convert it to other formats like a Pandas dataframe:

df = ArgoDataFetcher().profile(6902746, 34).load().data.to_dataframe()

or to export it to files:

ds = ArgoDataFetcher().region([-85,-45,10.,20.,0,100.]).to_xarray()
ds.to_netcdf('my_selection.nc')
# or by profiles:
ds.argo.point2profile().to_netcdf('my_selection.nc')

Fetching only Argo index

Argo index are returned as pandas dataframe. Index fetchers works similarly to data fetchers.

Load the Argo index fetcher:

    from argopy import IndexFetcher as ArgoIndexFetcher

then, set it up to request index for a specific space/time domain:

    index_loader = ArgoIndexFetcher().region([-85,-45,10.,20.])
    index_loader = ArgoIndexFetcher().region([-85,-45,10.,20.,'2012-01','2014-12'])

or for one or a collection of floats:

    index_loader = ArgoIndexFetcher().float(6902746)
    index_loader = ArgoIndexFetcher().float([6902746, 6902747, 6902757, 6902766])   

Once your fetcher is initialized you can trigger fetch/load index like this:

    df = index_loader.to_dataframe()  # or
    df = index_loader.load().index

Note that like the data fetcher, the index fetcher can use different sources, a local copy of the GDAC ftp for instance:

    index_fetcher = ArgoIndexFetcher(src='localftp', path_ftp='/path/to/your/argo/ftp/', index_file='ar_index_global_prof.txt')

Visualisation

For plottings methods, you'll need matplotlib and possibly cartopy and seaborn installed. Argo Data and Index fetchers provide direct plotting methods, for instance:

    ArgoDataFetcher().float([6902745, 6902746]).plot('trajectory')    

index_traj

See the documentation page for more examples.

Development roadmap

See milestone here: https://github.com/euroargodev/argopy/milestone/3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argopy-0.1.9.tar.gz (96.5 kB view details)

Uploaded Source

Built Distribution

argopy-0.1.9-py3-none-any.whl (119.0 kB view details)

Uploaded Python 3

File details

Details for the file argopy-0.1.9.tar.gz.

File metadata

  • Download URL: argopy-0.1.9.tar.gz
  • Upload date:
  • Size: 96.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for argopy-0.1.9.tar.gz
Algorithm Hash digest
SHA256 855978327f773f8eabb4fe904072ce16571c9501ae365c3acdc3e9cda931dcc7
MD5 2e4a449253ef0738657657b4f9ace148
BLAKE2b-256 8f5ed9e35e20cca20cc285cf493e73799b6121a5c5edfc36cee44e6c510511d4

See more details on using hashes here.

File details

Details for the file argopy-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: argopy-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 119.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for argopy-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 203b60baf7c97e8f9e4280fb6ceaebebd8d80f5de69af40c6d828e74ea649793
MD5 f15b4fdabad991987c7989f62c06ad60
BLAKE2b-256 e27ef85459d461da5c9a38926367e0c66a5bf000df8e3e43622746cf82b01f34

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page