Package: pynldas2
PackageDescriptionStatusPyNHDNavigate and subset NHDPlus (MR and HR) using web servicesPy3DEPAccess topographic data through National Map’s 3DEP web servicePyGeoHydroAccess NWIS, NID, WQP, eHydro, NLCD, CAMELS, and SSEBop databasesPyDaymetAccess daily, monthly, and annual climate data via DaymetPyGridMETAccess daily climate data via GridMETPyNLDAS2Access hourly NLDAS-2 data via web servicesHydroSignaturesA collection of tools for computing hydrological signaturesAsyncRetrieverHigh-level API for asynchronous requests with persistent cachingPyGeoOGCSend queries to any ArcGIS RESTful-, WMS-, and WFS-based servicesPyGeoUtilsUtilities for manipulating geospatial, (Geo)JSON, and (Geo)TIFF dataPyNLDAS2: Hourly NLDAS-2 Forcing DataFeaturesPyNLDAS2 is a part ofHyRiversoftware stack that
is designed to aid in hydroclimate analysis through web services. This package
provides accessNLDAS-2 Forcing datasetviaHydrology Data Rods.
Currently, only hourly data is supported. There are three main functions:get_bycoords: Forcing data for a list of coordinates as apandas.DataFrameorxarray.Dataset,get_bygeom: Forcing data within a geometry as axarray.Dataset,get_grid_mask: NLDAS2land/water grid maskas axarray.Dataset.PyNLDAS2 only provides access to the hourly NLDAS2 dataset, so if you need to access
other NASA climate datasets you can check outtsgettoolboxdeveloped byTim Cera.Moreover, under the hood, PyNLDAS2 usesPyGeoOGCandAsyncRetrieverpackages
for making requests in parallel and storing responses in chunks. This improves the
reliability and speed of data retrieval significantly.You can control the request/response caching behavior and verbosity of the package
by setting the following environment variables:HYRIVER_CACHE_NAME: Path to the caching SQLite database for asynchronous HTTP
requests. It defaults to./cache/aiohttp_cache.sqliteHYRIVER_CACHE_NAME_HTTP: Path to the caching SQLite database for HTTP requests.
It defaults to./cache/http_cache.sqliteHYRIVER_CACHE_EXPIRE: Expiration time for cached requests in seconds. It defaults to
one week.HYRIVER_CACHE_DISABLE: Disable reading/writing from/to the cache. The default is false.HYRIVER_SSL_CERT: Path to a SSL certificate file.For example, in your code before making any requests you can do:importosos.environ["HYRIVER_CACHE_NAME"]="path/to/aiohttp_cache.sqlite"os.environ["HYRIVER_CACHE_NAME_HTTP"]="path/to/http_cache.sqlite"os.environ["HYRIVER_CACHE_EXPIRE"]="3600"os.environ["HYRIVER_CACHE_DISABLE"]="true"os.environ["HYRIVER_SSL_CERT"]="path/to/cert.pem"You can find some example notebookshere.You can also try using PyNLDAS2 without installing
it on your system by clicking on the binder badge. A Jupyter Lab
instance with the HyRiver stack pre-installed will be launched in your web browser, and you
can start coding!Moreover, requests for additional functionalities can be submitted viaissue tracker.CitationIf you use any of HyRiver packages in your research, we appreciate citations:@article{Chegini_2021,author={Chegini, Taher and Li, Hong-Yi and Leung, L. Ruby},doi={10.21105/joss.03175},journal={Journal of Open Source Software},month={10},number={66},pages={1--3},title={{HyRiver: Hydroclimate Data Retriever}},volume={6},year={2021}}InstallationYou can installpynldas2usingpip:$pipinstallpynldas2Alternatively,pynldas2can be installed from theconda-forgerepository
usingConda:$condainstall-cconda-forgepynldas2Quick startThe NLDAS2 database provides forcing data at 1/8th-degree grid spacing and range
from 01 Jan 1979 to present. Let’s take a look at NLDAS2 grid mask that includes
land, water, soil, and vegetation masks:importpynldas2asnldasgrid=nldas.get_grid_mask()Next, we usePyGeoHydroto get the
geometry of a HUC8 with ID of 1306003, then we get the forcing data within the
obtained geometry.frompygeohydroimportWBDhuc8=WBD("huc8")geometry=huc8.byids("huc8","13060003").geometry[0]clm=nldas.get_bygeom(geometry,"2010-01-01","2010-01-31",4326)Road Map[ ] Add PET calculation functions similar toPyDaymetbut at hourly timescale.[ ] Add a command line interfaces.ContributingContributions are appreciated and very welcomed. Please readCONTRIBUTING.rstfor instructions.