# Daymet downloader for Raven
<a href='https://pypi.org/project/ddfrvn/' target='_blank'>
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/ddfrvn">
</a>
<a href='https://github.com/Scriptbash/DaymetDownloaderForRaven/blob/main/LICENSE' target='_blank'>
<img alt="GitHub License" src="https://img.shields.io/github/license/Scriptbash/DaymetDownloaderForRaven">
</a>
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.
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](https://github.com/julemai/GridWeightsGenerator).
## Installation
```shell
pip install ddfrvn
```
## Usage
```python
ddfr [-h] [-i INPUT] [-s START] [-e END] [-v VARIABLES] [-f] [-m] [-g] [-o OUTPUT] [-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).
-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:
```python
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:
```python
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)
```python
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:
```python
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 maximum temperature and increase the request timeout:
```python
ddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmax' -o '/Users/francis/Documents/output' -t 360
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Scriptbash/DaymetDownloaderForRaven",
"name": "ddfrvn",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "daymet, raven, hydrology",
"author": "Francis Lapointe",
"author_email": "francis.lapointe5@usherbrooke.ca",
"download_url": "https://files.pythonhosted.org/packages/8a/a7/6b1e95c811cf6472f478d82303f59f498f8871231e7fa7ea158936a0ca4e/ddfrvn-1.0.0.tar.gz",
"platform": null,
"description": "# Daymet downloader for Raven\n<a href='https://pypi.org/project/ddfrvn/' target='_blank'>\n <img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/ddfrvn\">\n</a>\n<a href='https://github.com/Scriptbash/DaymetDownloaderForRaven/blob/main/LICENSE' target='_blank'>\n <img alt=\"GitHub License\" src=\"https://img.shields.io/github/license/Scriptbash/DaymetDownloaderForRaven\">\n</a>\n\nDownload and process Daymet data for use in the Raven hydrological modelling framework.\n\n## Features\n - Download Daymet data using a polygon shapefile.\n - Fix NaN values and insert missing dates.\n - Merge the downloaded files.\n - Generate a simple grid weights file.\n\nThis 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.\n\nThe grid weights generated assign equal weight to every cell. For a more advanced approach to generating grid weights, please refer to the [GridWeightsGenerator](https://github.com/julemai/GridWeightsGenerator).\n\n## Installation\n\n```shell\npip install ddfrvn\n```\n\n## Usage\n\n```python\nddfr [-h] [-i INPUT] [-s START] [-e END] [-v VARIABLES] [-f] [-m] [-g] [-o OUTPUT] [-t TIMEOUT]\n```\nOptions:\n```\n -h, --help - Show this help message and exit.\n -i INPUT, --input - Path to the watershed shapefile.\n (required for spatial extraction of Daymet data).\n -s START, --start START - Start date for the data download (format: YYYY-MM-DD).\n -e END, --end END - End date for the data download (format: YYYY-MM-DD).\n -v VARIABLES, --variables VARIABLES - Comma-separated list of climate variables to download \n (e.g., 'tmax,tmin,prcp,swe,srad,vp,dayl').\n -f, --fix_nan - [optional] Enable this flag to fix NaN values in the dataset by\n averaging neighboring cells or using prior day's data.\n -m, --merge - [optional] Merge all downloaded NetCDF files into a single output\n file (per variable).\n -g, --gridweights - [optional] Generate a text file containing grid weights for Raven.\n -o OUTPUT, --output OUTPUT - Path to save the processed data (output directory).\n -t TIMEOUT, --timeout TIMEOUT - [optional] Maximum time (in seconds) to wait for network requests\n before timing out. Default is 120 seconds.\n```\n## Usage examples\n\nDownload minimum temperature and precipitation without processing:\n\n```python\nddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmin,prcp' -o '/Users/francis/Documents/output'\n```\n\nDownload minimum temperature and precipitation with processing:\n\n```python\nddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmin,prcp' -f -m -o '/Users/francis/Documents/output'\n```\n\nExample for Windows (Please use the Anaconda prompt or the console within your Python IDE)\n\n```python\nddfr -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\"\n```\n\nDownload maximum temperature and precipitation without processing and generate a grid weights file:\n\n```python\nddfr -i '/Users/francis/Documents/watershed.shp' -s 2012-01-01 -e 2012-12-31 -v 'tmax,prcp' -g -o '/Users/francis/Documents/output'\n```\n\nDownload maximum temperature and increase the request timeout:\n\n```python\nddfr -i '/Users/francis/Documents/watershed.shp' -s 2010-01-01 -e 2012-12-31 -v 'tmax' -o '/Users/francis/Documents/output' -t 360\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A CLI tool for downloading and processing Daymet NetCDF files for the Raven hydrological modelling framework.",
"version": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/Scriptbash/DaymetDownloaderForRaven/issues",
"Funding": "https://ko-fi.com/scriptbash",
"Homepage": "https://github.com/Scriptbash/DaymetDownloaderForRaven",
"Source": "https://github.com/Scriptbash/DaymetDownloaderForRaven"
},
"split_keywords": [
"daymet",
" raven",
" hydrology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "847e274c1490ba7a1cc2267932ed0c579d5b2df82c1c0b1e0e44313de14f374e",
"md5": "bc3c9d3fabcf855f69e9395a27d6928a",
"sha256": "01d87d5a98799cc2b9b4f49108a2b65ef9e1fb5e799ba0c07908970c237be505"
},
"downloads": -1,
"filename": "ddfrvn-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc3c9d3fabcf855f69e9395a27d6928a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9650,
"upload_time": "2024-10-07T21:21:29",
"upload_time_iso_8601": "2024-10-07T21:21:29.559340Z",
"url": "https://files.pythonhosted.org/packages/84/7e/274c1490ba7a1cc2267932ed0c579d5b2df82c1c0b1e0e44313de14f374e/ddfrvn-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8aa76b1e95c811cf6472f478d82303f59f498f8871231e7fa7ea158936a0ca4e",
"md5": "2bf2d8508a68f30d34af63e040eaafe1",
"sha256": "b3001a6a7daa3eac3f9af289b2fd597dd3830112f73072f18e5cdfe205560ec1"
},
"downloads": -1,
"filename": "ddfrvn-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "2bf2d8508a68f30d34af63e040eaafe1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 10107,
"upload_time": "2024-10-07T21:21:31",
"upload_time_iso_8601": "2024-10-07T21:21:31.157365Z",
"url": "https://files.pythonhosted.org/packages/8a/a7/6b1e95c811cf6472f478d82303f59f498f8871231e7fa7ea158936a0ca4e/ddfrvn-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-07 21:21:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Scriptbash",
"github_project": "DaymetDownloaderForRaven",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ddfrvn"
}