Access the climate data from the Daymet database through ORNL's RESTful service.
Project description
Package |
Description |
---|---|
Access NWIS, HCDN 2009, NLCD, and SSEBop databases |
|
Query data from any ArcGIS RESTful-, WMS-, and WFS-based services |
|
Convert responses from PyGeoOGC’s supported web services to datasets |
|
Access NLDI and WaterData web services for navigating the NHDPlus database |
|
Access topographic data through the 3D Elevation Program (3DEP) web service |
|
Access the Daymet database for daily climate data |
PyDaymet: Daily climate data through Daymet
🚨 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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pydaymet-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1be95263b0146e8e5e8b93be421bf62df32a77974aae04fed969337fabcea191 |
|
MD5 | 080fdfb1271b5ba8b7e5b667159a9875 |
|
BLAKE2b-256 | 4516c021362b9ea0085cb0361f9daf8198f6687eb6f6add8b155c6941ebdf86a |