Giter Site home page Giter Site logo

luzpaz / argopy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from euroargodev/argopy

0.0 1.0 0.0 5.19 MB

A python library for Argo data beginners and experts

Home Page: https://argopy.readthedocs.io

License: Apache License 2.0

Python 99.72% Shell 0.28%

argopy's Introduction

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

pip install 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

Our next big steps:

  • To provide Bio-geochemical variables (#22, #77, #81)
  • To develop expert methods related to Quality Control of the data with other python softwares like:

We aim to provide high level helper methods to load Argo data and meta-data from:

  • Ifremer erddap
  • local copy of the GDAC ftp folder
  • Index files (local and online)
  • Argovis
  • Online GDAC ftp

We also aim to provide high level helper methods to visualise and plot Argo data and meta-data:

  • Map with trajectories
  • Histograms for meta-data
  • Waterfall plots
  • T/S diagram

argopy's People

Contributors

damienirving avatar dependabot[bot] avatar dhruvbalwada avatar docotak avatar gmaze avatar ocefpaf avatar quai20 avatar schwehr avatar tylertucker202 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.