Skip to main content

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: badge

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


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.0.tar.gz (15.8 kB view hashes)

Uploaded Source

Built Distributions

argopy-0.1.0-py3.6.egg (17.9 kB view hashes)

Uploaded Source

argopy-0.1.0-py3-none-any.whl (19.0 kB view hashes)

Uploaded Python 3

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