A python library for Argo data beginners and experts
Project description
Argo data python library
argopy
is a python library that aims to easy Argo data access, visualisation and manipulation for regular users as well as Argo experts and operators.
Several python packages exist: we are currently in the process of merging and structuring these libraries to have a single powerfull tool.
Install
Since this is a library in active development, use direct install from this repo to benefit from the last version:
pip install git+http://github.com/euroargodev/argopy.git
Examples
Examples of data fetching, manipulation and visualisation are available on the erddap examples repository.
You can run and test live example notebooks on Binder (thanks Pangeo) here:
Usage
The primary data model used to manipulate Argo data is xarray.
Argo Data Fetcher
API usage:
from argopy import DataFetcher as ArgoDataFetcher
argo_loader = ArgoDataFetcher()
argo_loader = ArgoDataFetcher(backend='erddap')
argo_loader = ArgoDataFetcher(cachedir='tmp')
argo_loader.region([-85,-45,10.,20.,0,1000.]).to_xarray()
argo_loader.region([-85,-45,10.,20.,0,1000.,'2012-01','2014-12']).to_xarray()
argo_loader.profile(6902746, 34).to_xarray()
argo_loader.profile(6902746, np.arange(12,45)).to_xarray()
argo_loader.profile(6902746, [1,12]).to_xarray()
argo_loader.float(6902746).to_xarray()
argo_loader.float([6902746, 6902747, 6902757, 6902766]).to_xarray()
argo_loader.float([6902746, 6902747, 6902757, 6902766], CYC=1).to_xarray()
Devlopment roadmap:
We aim to provide high level helper methods to load Argo data from:
- Ifremer erddap
- local copy of the GDAC ftp folder (help wanted)
- the argovis dataset (help wanted)
- any other usefull access point to Argo data ?
At this point data are fetched in memory as xarray.DataSet. From there, it is easy to convert it to other formats like a Pandas dataframe:
ds = argo_loader.profile(6902746, 34).to_xarray()
df = ds.to_dataframe()
and to export it to files:
ds = argo_loader.region([-85,-45,10.,20.,0,1000.]).to_xarray()
ds.to_netcdf('my_selection.nc')
# or by profiles:
ds.argo.point2profile().to_netcdf('my_selection.nc')
Argo data manipulation with xarray
The argopy
library provides an xarray accessor named argo
to help manipulate and analyse data.
Example: Convert a collection of points to a collections of profiles:
from argopy import DataFetcher as ArgoDataFetcher
ds = ArgoDataFetcher(ds='bgc').float(5903248).to_xarray()
ds = ds.argo.point2profile()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.