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/master/docs/_static/pydaymet_logo.png

Package

Description

Hydrodata

Access NWIS, HCDN 2009, NLCD, and SSEBop databases

PyGeoOGC

Query data from any ArcGIS RESTful-, WMS-, and WFS-based services

PyGeoUtils

Convert responses from PyGeoOGC’s supported web services to datasets

PyNHD

Access NLDI and WaterData web services for navigating the NHDPlus database

Py3DEP

Access topographic data through the 3D Elevation Program (3DEP) web service

PyDaymet

Access the Daymet database for daily climate data

PyDaymet: Daily climate data through Daymet

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 to 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 requests and xarray.Dataset for gridded data requests. 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

Quick start

PyDaymet offers two functions for getting climate data; get_byloc and get_bygeom. The arguments of these functions are identical except the first argument where the latter should be polygon and the former should be a coordinate (a tuple of length two as in (x, y)). The input geometry or coordinate can be in any valid CRS (defaults to EPSG:4326). The dates argument can be either a tuple of length two like (start_str, end_str) or a list of years like [2000, 2005]. 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, variables=variables, pet=True)

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

Some example plots are shown below:

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

Contributing

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

Credits

Credits to Koen Hufkens for his implementation of accessing the Daymet RESTful service, daymetpy.

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.3.tar.gz (26.3 kB view hashes)

Uploaded Source

Built Distribution

pydaymet-0.1.3-py2.py3-none-any.whl (12.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