Skip to main content

Access the climate data from the Daymet database through ORNL's RESTful service.

Project description

https://raw.githubusercontent.com/cheginit/hydrodata/develop/docs/_static/pydaymet_logo.png

PyPi Conda Version CodeCov Github Actions Binder

CodeFactor black pre-commit

🚨 This package is under heavy development and breaking changes are likely to happen. 🚨

Features

PyDaymet is a part of Hydrodata software stack and provides an interface to access daily climate data through the Daymet RESTful service. Both single pixel and gridded data can be requested which are returned as pandas.DataFrame for single pixel and xarray.Dataset for gridded data. Additionally, it can compute Potential EvapoTranspiration (PET) using UN-FAO 56 paper method for both single pixel and gridded data.

You can try using PyDaymet without installing it on you system by clicking on the binder badge below the PyDaymet banner. A Jupyter notebook instance with the Hydrodata software stack pre-installed will be launched in your web browser and you can start coding!

Moreover, requests for additional functionalities can be submitted via issue tracker.

Installation

You can install pydaymet using pip after installing libgdal on your system (for example, in Ubuntu run sudo apt install libgdal-dev):

$ pip install pydaymet

Alternatively, pydaymet can be installed from the conda-forge repository using Conda:

$ conda install -c conda-forge pydaymet

Quickstart

PyDaymet offers two functions for getting climate data; get_byloc and get_bygeom. The arguments of these function are identical except that the first argument of the latter should be polygon and the former a coordinate (a tuple of length two as in (x, y)). The input geometry or coordinates can be any valid CRS and by default EPSG:4326 is considered as the input CRS. It is noted that both functions have a pet flag for computing PET.

from pynhd import NLDI
import pydaymet as daymet

dates = ("2000-01-01", "2000-06-12")
variables = ["prcp", "tmin"]

geometry = NLDI.getfeature_byid("nwissite", "USGS-01031500", basin=True).geometry[0]
clm_g = daymet.get_bygeom(geometry, dates=dates, variables=variables, pet=True)

coords = (-1431147.7928, 318483.4618)
crs = "epsg:3542"
clm_p = daymet.get_byloc(coords, crs=crs, dates=dates, variables=variables, pet=True)

Some example plots are shown below:

https://raw.githubusercontent.com/cheginit/hydrodata/develop/docs/_static/example_plots_pydaymet.png

Contributing

Contributions are very welcomed. Please read CONTRIBUTING.rst file for instructions.

Credits

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

pydaymet-0.1.0.tar.gz (22.5 kB view hashes)

Uploaded Source

Built Distribution

pydaymet-0.1.0-py2.py3-none-any.whl (10.8 kB view hashes)

Uploaded Python 2 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