GithubHelp home page GithubHelp logo

natgeo-wong / cdsapi.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliaclimate/cdsapi.jl

0.0 1.0 0.0 59 KB

Julia API to the Climate Data Store (a.k.a. CDS)

Home Page: https://cds.climate.copernicus.eu

License: MIT License

Julia 100.00%

cdsapi.jl's Introduction

CDSAPI.jl

Repo Status Travis CI CodeCov
MIT License Latest Release Latest Documentation Latest Documentation

Contributors: @michiboo @juliohm @LakshyaKhatri @natgeo-wong

Introduction

This package provides access to the Climate Data Store (a.k.a. CDS) service.

The CDS website provides a Show API request button at the bottom of the download tab of each dataset. This button generates the code to download the dataset with the Python cdsapi module. We've designed this Julia package so that one could copy/paste the generated Python code with minimum modification in Julia.

CDSAPI.jl can be installed via

] add CDSAPI

Requirements

You must have a CDS account and have ensured that your ~/.cdsapirc file exists. Instructions on how to create the file for your user account can be found here.

Usage

The main functionality of CDSAPI.jl is based on the retrieve() function. retrieve() has three main keywords (in the following order)

retrieve(
    dataset -> specifies the particular CDS dataset you are retrieving
    params  -> a Julia Dictionary containing keywords with information on details such as
               date, time, variable, pressure level, etc.
    fname   -> name of the file you are downloading into
)

For example, if I wanted to retrieve information on ERA5's Land Sea Mask on 2011 Jan 01 for the entire globe, I would do the following:

pfnc = "plot-GLBx0.25-lsm.nc"
plsm = Dict(
    "product_type" => "reanalysis",
    "variable"     => "land_sea_mask",
    "year"         => 2011,
    "month"        => 1,
    "day"          => 1,
    "time"         => "00:00",
    "format"       => "netcdf"
)
retrieve("reanalysis-era5-single-levels",plsm,pfnc)

This would therefore retrieve the Land Sea Mask in ERA5 at this point in time and save it into the NetCDF file plot-GLBx0.25-lsm.nc. Unless a path is specified in front the file name, Julia will create the file plot-GLBx0.25-lsm.nc in the current directory.

You can also look at the test folder to see more examples.

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.