A CLI tool for downloading and processing Daymet NetCDF files for the Raven hydrological modelling framework.
Project description
Daymet downloader for Raven
Download and process Daymet data for use in the Raven hydrological modelling framework.
Features
- Download Daymet data using a polygon shapefile.
- Fix NaN values and insert missing dates.
- Merge the downloaded files.
- Generate a simple grid weights file.
- Convert the downloaded variables into a .csv, .txt or .rvt file.
This utility supports both single polygon and multipolygon shapefiles. Please note that multipolygon shapefiles are treated as Hydrological Response Units (HRUs). As such, avoid using multipolygon files that represent different watersheds.
The grid weights generated assign equal weight to every cell. For a more advanced approach to generating grid weights, please refer to the GridWeightsGenerator.
Installation
pip install ddfrvn
Usage
ddfr [-h] [-i INPUT] [-s START] [-e END] [-v VARIABLES] [-f] [-m] [-g] [-o OUTPUT] [-c FORMAT] [-t TIMEOUT]
Options:
-h, --help - Show this help message and exit.
-i INPUT, --input - Path to the watershed shapefile.
(required for spatial extraction of Daymet data).
-s START, --start START - Start date for the data download (format: YYYY-MM-DD).
-e END, --end END - End date for the data download (format: YYYY-MM-DD).
-v VARIABLES, --variables VARIABLES - Comma-separated list of climate variables to download
(e.g., 'tmax,tmin,prcp,swe,srad,vp,dayl').
-f, --fix_nan - [optional] Enable this flag to fix NaN values in the dataset by
averaging neighboring cells or using prior day's data.
-m, --merge - [optional] Merge all downloaded NetCDF files into a single output
file (per variable).
-g, --gridweights - [optional] Generate a text file containing grid weights for Raven.
-o OUTPUT, --output OUTPUT - Path to save the processed data (output directory).
-c FORMAT, --convert FORMAT - [optional] Converts the output into a csv, rvt or txt file (e.g, 'csv', 'rvt', 'txt').
-t TIMEOUT, --timeout TIMEOUT - [optional] Maximum time (in seconds) to wait for network requests
before timing out. Default is 120 seconds.
Usage examples
Download minimum temperature and precipitation without processing:
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmin,prcp' -o '/Users/francis/Documents/output'
Download minimum temperature and precipitation with processing:
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmin,prcp' -f -m -o '/Users/francis/Documents/output'
Example for Windows (Please use the Anaconda prompt or the console within your Python IDE):
ddfr -i "C:\Users\francis\Documents\watershed.shp" -s 2000-01-01 -e 2005-12-31 -v "srad,swe" -f -m -o "C:\Users\francis\Documents\output"
Download maximum temperature and precipitation without processing and generate a grid weights file:
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2012-01-01 -e 2012-12-31 -v 'tmax,prcp' -g -o '/Users/francis/Documents/output'
Download minimum, maximum temperature and precipitation with processing and convert the output to a rvt file:
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmin,tmax,prcp' -f -m -o '/Users/francis/Documents/output' -c 'rvt'
Download maximum temperature and increase the request timeout:
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmax' -o '/Users/francis/Documents/output' -t 360
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ddfrvn-1.1.0.tar.gz.
File metadata
- Download URL: ddfrvn-1.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a96aed425e9e4c75be2c297a9e0acf2c69df4a89692eff6062a8d04dc30ccb84
|
|
| MD5 |
dd8daf094ebf0451afb4eb3d315b4d13
|
|
| BLAKE2b-256 |
9104c0fec9cb4984678db1dfa9dad7dccda613463ad47087ad47c4f0303a0bc0
|
Provenance
The following attestation bundles were made for ddfrvn-1.1.0.tar.gz:
Publisher:
publish.yml on Scriptbash/DaymetDownloaderForRaven
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ddfrvn-1.1.0.tar.gz -
Subject digest:
a96aed425e9e4c75be2c297a9e0acf2c69df4a89692eff6062a8d04dc30ccb84 - Sigstore transparency entry: 268020024
- Sigstore integration time:
-
Permalink:
Scriptbash/DaymetDownloaderForRaven@482cafd6d5a179fbb145865befa0ad2adfed50d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Scriptbash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@482cafd6d5a179fbb145865befa0ad2adfed50d7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ddfrvn-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ddfrvn-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44c7f5211aa5c547b7286c79a68ee02f2dff0a11a9041623fde00eb86d7a2163
|
|
| MD5 |
b6c95a5ea35eaa1a1245d5ad731aae03
|
|
| BLAKE2b-256 |
bdfb0c9c6b554830c29ed3093e61cb41b0a2cf2476f15a51294c2d61e2fb05c8
|
Provenance
The following attestation bundles were made for ddfrvn-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on Scriptbash/DaymetDownloaderForRaven
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ddfrvn-1.1.0-py3-none-any.whl -
Subject digest:
44c7f5211aa5c547b7286c79a68ee02f2dff0a11a9041623fde00eb86d7a2163 - Sigstore transparency entry: 268020040
- Sigstore integration time:
-
Permalink:
Scriptbash/DaymetDownloaderForRaven@482cafd6d5a179fbb145865befa0ad2adfed50d7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Scriptbash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@482cafd6d5a179fbb145865befa0ad2adfed50d7 -
Trigger Event:
workflow_dispatch
-
Statement type: