Giter Club home page Giter Club logo

noaaclass's Introduction

noaaclass

Gitter

License Downloads Build Status Coverage Status Code Health PyPI version Stories in Ready

A python library that allow to request images to the NOAA CLASS (Comprehensive Large Array-Data Stewardship System).

Requirements

If you want to use this library on any GNU/Linux or OSX system you just need to execute:

$ pip install noaaclass

If you want to improve this library, you should download the github repository and execute:

$ make virtualenv deploy

Under ubuntu/debian you can try with:

$ make ubuntu virtualenv deploy

Testing

To test all the project you should use the command:

$ make test

If you want to help us or report an issue join to us through the GitHub issue tracker.

Example

It can show all the supported products to be subscribed:

from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
print noaa.subscribe.products()

Then it can create new subscriptions to the gvar_img product:

from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
data = [
    {
        'id': '+',
        'enabled': True,
        'name': '[auto] sample1',
        'north': -26.72,
        'south': -43.59,
        'west': -71.02,
        'east': -48.52,
        'coverage': ['SH'],
        'schedule': ['R'],
        'satellite': ['G13'],
        'channel': [1],
        'format': 'NetCDF',
    },
    {
        'id': '+',
        'enabled': False,
        'name': '[auto] sample2',
        'north': -26.73,
        'south': -43.52,
        'west': -71.06,
        'east': -48.51,
        'coverage': ['SH'],
        'schedule': ['R'],
        'satellite': ['G13'],
        'channel': [2],
        'format': 'NetCDF',
    },
]
noaa.subscribe.gvar_img.set(data)

Next, you can retrieve all the subscriptions to the gvar_img product:

from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
data = noaa.subscribe.gvar_img.get()

Also, you can modify or delete the previous subscriptions:

from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
data = noaa.subscribe.gvar_img.get()
data[1]['name'] = '[auto] name changed!'
data[1]['enabled'] = True
data.pop(0)
data = noaa.subscribe.gvar_img.set(data)

In the other hand, if you want an historic data raise a request:

data = [
    {
        'id': '+',
        'north': -26.72,
        'south': -43.59,
        'west': -71.02,
        'east': -48.52,
        'coverage': ['SH'],
        'schedule': ['R'],
        'satellite': ['G13'],
        'channel': [1],
        'format': 'NetCDF',
        'start': datetime(2014, 9, 16, 10, 0, 0),
        'end': datetime(2014, 9, 16, 17, 59, 59)
    },
    {
        'id': '+',
        'north': -26.73,
        'south': -43.52,
        'west': -71.06,
        'east': -48.51,
        'coverage': ['SH'],
        'schedule': ['R'],
        'satellite': ['G13'],
        'channel': [2],
        'format': 'NetCDF',
        'start': datetime(2014, 9, 2, 10, 0, 0),
        'end': datetime(2014, 9, 3, 17, 59, 59)
    },
]
from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
data = noaa.request.gvar_img.set(data, async=True)

And, if you want to retrieve the requests made in the last 2 hours:

from noaaclass import noaaclass
noaa = noaaclass.connect('username', 'password')
data = noaa.request.gvar_img.get(async=True, hours = 2, append_files=True)

Last, when the site is down you can get the next datetime (in UTC format) in which the website is going to be running:

from noaaclass import noaaclass
noaaclass.next_up_datetime()

About

This software is developed by GERSolar. You can contact us to [email protected].

noaaclass's People

Contributors

ecolell avatar santiagomelendez avatar gitter-badger avatar

Watchers

James Cloos avatar  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.