Giter Club home page Giter Club logo

yodapy's Introduction

Build Status Build status Coverage Status CodeFactor License: MIT

yodapy

Your Ocean Data Access in Python (YODAPY)

Installation

pip install yodapy

Install directly from github

For developers and testers:

pip install git+https://github.com/cormorack/yodapy.git

Implication of installing yodapy in a Jupyter notebook environment

In a Jupyter environment the operating system is a static image; which has a certain set of packages installed. Let's assume this does not include yodapy or that it includes an older version of yodapy and I am interested in a more recent version. If I install a new (say yodapy) package during a notebook session: That does not register in the stored static image. The only thing that persists in my computing environment is my home directory. This includes code, repos, data, ancillary files and so on; but it does not include Python packages that I install on the fly.

This suggests a question: Can I put some installation commands in my .cshrc file so that it runs automatically whenever I start up a new image?

Development

git clone https://github.com/cormorack/yodapy.git
cd yodapy
conda create -n yodapy -c conda-forge --yes python=3.6 --file requirements.txt --file requirements-dev.txt
source activate yodapy
pip install -e .

Credentials

To obtain credentials you are obliged to register at the OOI data portal. Select the Log In dropdown and click Register. Fill out and submit the form and you will automatically be logged in. Click on your email ID (upper right) to visit/edit your profile. This profile now includes your credentials. You should click on the button Refresh API Token to get a stable token; and then make a note of both your username (format OOIAPI-XXXXXXXXXXXXXX) and your token (format XXXXXXXXXXX). They are used in what follows.

To start using yodapy for the ooi datasource, you will need to setup your credential file. This will only need be set one time.

>>> from yodapy.utils.creds import set_credentials_file
>>> set_credentials_file(data_source='ooi', username='MyName', token='My secret token')

Example running the program

>>> from yodapy.datasources import OOI
>>> ooi = OOI()
>>> ooi.search(region='cabled', site='axial base shallow profiler', node='shallow profiler', instrument='CTD')
>>> ooi.view_instruments()
>>> ooi.data_availability()
>>> begin_date = '2018-01-01'
>>> end_date = '2018-01-02'
>>> ooi.request_data(begin_date=begin_date, end_date=end_date)
>>> ooi.check_status()
Request Completed
>>> ds_list = ooi.to_xarray()

yodapy's People

Contributors

amarburg avatar jakesteinberg avatar lsetiawan avatar ocefpaf avatar pshivraj avatar robfatland avatar s-kganz 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.