{ "info": { "author": "Micah Johnson", "author_email": "micah.johnson150@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# BASIN SETUP TOOL v0.12.2\n\n[![Docker Build Status](https://img.shields.io/docker/build/usdaarsnwrc/basin_setup.svg)](https://hub.docker.com/r/usdaarsnwrc/basin_setup/)\n\nThe basin setup tool is a python script designed to create the required\ninputs for running [SMRF](https://smrf.readthedocs.io/en/develop/) and\n[AWSM](https://github.com/USDA-ARS-NWRC/AWSM) snow simulations.\n\n## INSTALL\n\n**Prequisites**:\n\n - GDAL 2.3.2\n - Python\\>=3.5\n - pip 19.2.1\n\nTo begin the install for basin\\_setup, ensure that GDAL is compiled from\nsource. Note: Do not install the python library for GDAL but rather the\ncommand line utiltiies. To compile from source follow the instructions\nprovided at:\n\n\n\nOnce GDAL is installed, install the python requirements using pip:\n\n``` bash\n$ pip install -r requirements.txt\n```\n\nFinally to install basin\\_setup for commandline use use:\n\n``` bash\n$ sudo make install\n```\n\nIf you want to develop on basin\\_setup use the following command to\ninstall the utility so that you changes to the source will be used\nwithout having to reinstall\n\n``` bash\n$ sudo make develop\n```\n\n## Commands\nThere are 3 commands that are installed after installing using the make file.\n\n1. [basin_setup](#basin\\_setup) - creates all the images for running SMRF/AWSM\n2. [delineate](#delineate) - Automatically delineates a new basin.\n3. [grm](#grm) - Aggregates Lidar snow depths into a single netcdf\n\n----\n## basin\\_setup\n----\nThe basin_setup\noutputs a single netcdf file containing:\n\n - Basin mask\n - Basin DEM\n - Basin Vegetation type (From Landfire)\n - Basin Vegetation Height (From Landfire)\n - Basin Vegetation Tau\n - Basin Vegetation K\n -\n#### General Usage\n\nTo use basin\\_setup you only need a shapefile of your basins boundary\nand a dem that contains the the extents of the shapefile. **It is\nrequired that the shapefile is in UTM.** The projection of the DEM wil\nbe converted to that of the shapefile.\n\nTo use basin\\_setup at it's simplest form, just provide a shapefile and\ndem:\n\n**Easiest Use**\n\n``` bash\n$ basin_setup -f rme_basin_outline.shp -dm ~/Downloads/ASTGTM2_N43W117/ASTGTM2_N43W117_dem.tif\n```\n\n**Custom Cell Size** To specify the cell size use the cellsize flag\nwhich is specified in meters, if it is not used the default is\n50m:\n\n``` bash\n$ basin_setup -f rme_basin_outline.shp -dm ~/Downloads/ASTGTM2_N43W117/ASTGTM2_N43W117_dem.tif --cell_size 10\n```\n\n**Switching Array Origin**\n\nOccasionally an image will have the correct coordinates and orientation\nbut its array will have a different origin than expected. This can\nhappen when alternating between raster images and other data sets. For\nexample, using the commands above will produce successful topo.nc for\nSMRF and will display correctly when using something like ncview (which\nconsiders the x and y data inputted). However if you were to simply plot\nwith imshow from matplotlib that data you will find is upside down, so\nthe default behavior flips the image. This is because of a difference in\narray origins. To not flip this use the ```--noflip``` flag which flips\nthe y axis data and the images over the x-axis resulting images\ncorrectly oriented in ncview and\nimshow.\n\n``` bash\n$ basin_setup -f rme_basin_outline.shp -dm ~/Downloads/ASTGTM2_N43W117/ASTGTM2_N43W117_dem.tif --noflip\n```\n#### Setting Up Point Models\n\nIt is possible to create what our group considers a point model. The\ngoal here is to create all the files necessary to run in SMRF/AWSM\nwithout having to change the SMRF/AWSM code to test the modeling system\non a point. This means creating the smallest sized topo possible. In\nthis case thats a 3X3 image. NetCDF dictates an image cannot be 1 pixel.\nBelow is the simplest way to create a point model for Reynolds Mountain\nEast's snow pillow site.\n\n**Easiest Use**\n\n``` bash\n$ basin_setup -p 519976,4768323 -dm ASTGTM2_N43W117_dem.tif --epsg 2153\n```\n\nNote: Until this code is improved the user must provided the EPSG code\nso the projection information can be obtained. If you are not sure what\nyour EPSG is use this link to find it.\n\n\nWith a point model there is sometimes the desire to use a uniform value\nfor variables. This is done by using the uniform flag.\n\n**Uniform Data**\n\n``` bash\n$ basin_setup -p 519976,4768323 -dm ASTGTM2_N43W117_dem.tif --epsg 2153 --uniform\n```\n\nWhich simply picks the middle cell and applies it everywhere. On this\nsame idea the DEM can be provided as a single value. So the user can\nchoose a different elevation than what an image can provide. E.g.\n\n**Custom DEM**\n\n``` bash\n$ basin_setup -p 519976,4768323 -dm 1000 --epsg 2153 --uniform\n```\n\n#### Using it in Docker\n\nBuilding GDAL can sometimes be a headache if you are unfamiliar with\nnormal build practices. If you would like to just use the tool with no\nquestions asked, then use the docker command. However note that the file\nstructure is what is represented inside the docker. So you must mount\nlocal directories to docker ones fortunately we have created a data\nfolder for you to do just that. Mounting these will also ensure files\nyou generate persist.\n\nThe commands are used the same but with\nextra:\n\n``` bash\n$ docker run -it --rm -v $(pwd):/data -v /:/data/downloads usdaarsnwrc/basin_setup:develop -f SHAPEFILE -dm DME_IMG -d /data/downloads\n```\n\nThe command above is:\n\n - Mounting the current working directory to the ```/data``` folder\n inside docker\n - Mounting the current working directory to the\n ```/data/downloads``` folder inside docker\n - Running basin_setup with the dowloads pointing to the docker side.\n\n----\n## delineate\n----\n\nThe delineation script automatically delineates a basin using pour points and\na dem. The tool is based on [TaudDEM](http://hydrology.usu.edu/taudem/taudem5/index.html).\n\nThe script will produce shapefiles of all the subbasins using a threshold.\nIt also saves data to allow for re-running faster.\n\n#### Features\n\n* Auto delineation.\n* Multiruns with multiple thresholds.\n* Rerun functionality to reduce computation time.\n* Outputs Shapefiles for basins and subbasins\n* Runs in parallel\n\n#### General Usage\n\n* pour points must be in a BNA format. The name of the points in the BNA file\n will be used as the name for the output files.\n* DEM must be a .tif\n*\n\n``` bash\n$ delineate -p pour_points.bna -d dem.tif --rerun -t 2000000 -n 2 --debug\n```\n\nUsing the debug flag will leave lots of extra files that were generated on the\nway in a folder named delineation\n\nTo get files necessary for s\n\n\n=======\nHistory\n=======\n\n0.1.0 (2017-12-05)\n------------------\n\n* Project Inception!\n\n0.2.0 (2018-02-17)\n------------------\n\n* documentation\n* point model setup\n* cell size bug fix #1\n\n\n0.3.0 (2018-09-07)\n------------------\n\n* Array flipping option\n* improved documentation\n* Python 3 compatibility\n* output unique veg values being used\n* Dockerfile!!\n\n0.4.0 (2017-10-16)\n------------------\n\n* Projection Information added\n* Project metdata and badges\n\n0.5.0 (2018-11-14)\n------------------\n\n* Fixes for #8 and #9\n* Updated Requirements\n* Added Makefile for installing\n* Prototype for a delineation script!\n\n0.6.0 (2018-11-14)\n------------------\n\n* Accidently Minor Bump\n\n0.7.0 (2018-11-21)\n------------------\n\n* Fixed Spelling errors in file management for delineate\n* Exanded delineate shapefile output including subassins\n* Improved documentation for delineate\n* Auto determining the projection info\n\n0.8.0 (2019-03-06)\n------------------\n\n* Fixes for #12, #15, #16, #17, #18\n* Data provenance work for delineate\n* Improvements to docker build\n* Output expanded in delineate for files required for Streamflow\n* Extracted functionality and moved to spatialnc\n* Added GRM tool for aggregating lidar flights into a netcdf from ASO\n\n\n0.9.0 (2019-07-18)\n------------------\n\n* Fixes for #27\n* Working on NaN assignments\n* Expanded resampling techniques for GRM\n\n\n0.10.0 (2019-07-18)\n------------------\n* Fixes for #24\n* Added in Static file output fro ARS streamflow modeling\n* Documentation Improvements\n\n\n0.11.0 (2019-08-09)\n------------------\n* Fixes for #31\n* First Release on Pypi\n* Converted Basin_setup to a python package not a collection of scripts\n* Vegetation Parameter requirements more strict, requiring a csv to dictate the interpretation\n* Updated Docker\n\n0.12.0 (2019-09-16)\n------------------\n* Fixes for #34\n* Added in CLI extents flag for cutting exactly to a known domain.\n* Added resampling to DEM and Veg Height layers, all else use nearest neighbor.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/USDA-ARS-NWRC/basin_setup", "keywords": "basin_setup,delineation,topo", "license": "CCO 1.0", "maintainer": "", "maintainer_email": "", "name": "basin-setup", "package_url": "https://pypi.org/project/basin-setup/", "platform": "", "project_url": "https://pypi.org/project/basin-setup/", "project_urls": { "Homepage": "https://github.com/USDA-ARS-NWRC/basin_setup" }, "release_url": "https://pypi.org/project/basin-setup/0.12.2/", "requires_dist": null, "requires_python": "", "summary": "A python package for building files for hydrologic modeling specifcally targeting smrf/awsm", "version": "0.12.2" }, "last_serial": 5909110, "releases": { "0.11.2": [ { "comment_text": "", "digests": { "md5": "fde16777ee5c9fcbd65dd31d02ec9e6d", "sha256": "ec781ae7dd8f3dd84f5bcf6b11190ac1c740fe0d74bd89b1a90338a44e554214" }, "downloads": -1, "filename": "basin_setup-0.11.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fde16777ee5c9fcbd65dd31d02ec9e6d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 51692, "upload_time": "2019-08-09T20:04:30", "url": "https://files.pythonhosted.org/packages/42/b0/99c405e194a2fda2a996777be5cc1937eebc55e3b6684b03ffb2975d0509/basin_setup-0.11.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1af5dc8f1d1165fa1e5a9df098b5b551", "sha256": "2aab98cbcb1f3dcd5e612f05b959ae4e5bd0cbbaa1f848a85d941b285ceb38e1" }, "downloads": -1, "filename": "basin_setup-0.11.2.tar.gz", "has_sig": false, "md5_digest": "1af5dc8f1d1165fa1e5a9df098b5b551", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36588, "upload_time": "2019-08-09T20:04:32", "url": "https://files.pythonhosted.org/packages/49/b1/707a46adadd4590634bc12f2120e02138344321e90c3d9ccc76af88defcd/basin_setup-0.11.2.tar.gz" } ], "0.12.0": [ { "comment_text": "", "digests": { "md5": "f25a2aeb6bf9233e28e5d575dcad7a3f", "sha256": "efd00cdd8c11902e16ec4e5673a758ba808056d3d4dffc6186b8fbd46f78608b" }, "downloads": -1, "filename": "basin_setup-0.12.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f25a2aeb6bf9233e28e5d575dcad7a3f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 48688, "upload_time": "2019-09-16T20:23:34", "url": "https://files.pythonhosted.org/packages/91/67/a5724b51420914369e8d581f22032c80dc81a7ec65e8745e225127fb6821/basin_setup-0.12.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b135b189052066f27849261f8282a8a", "sha256": "a4dc40166aac380a33be3beffbb587fc1172243df4ad3db49cd15753aceeae6a" }, "downloads": -1, "filename": "basin_setup-0.12.0.tar.gz", "has_sig": false, "md5_digest": "1b135b189052066f27849261f8282a8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37867, "upload_time": "2019-09-16T20:23:36", "url": "https://files.pythonhosted.org/packages/06/c3/4246dd379884a3fde1cfdbc2da04722e026e5ed7b960660335b23cf70463/basin_setup-0.12.0.tar.gz" } ], "0.12.1": [ { "comment_text": "", "digests": { "md5": "0f5dcedc4b66ef862b6b831c1ae6cdf6", "sha256": "337fd39772462573da82d44ff2ffefb8522a8f57171235b4f804b68463a2b931" }, "downloads": -1, "filename": "basin_setup-0.12.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0f5dcedc4b66ef862b6b831c1ae6cdf6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 48312, "upload_time": "2019-09-24T20:58:32", "url": "https://files.pythonhosted.org/packages/4f/b2/2f5a0ff60c3e04dac505ca67f76352b4370c79c3ca65c9bca5454b2bb449/basin_setup-0.12.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc93e7f36187204bdd66a6294c304115", "sha256": "847f45555f69066a481076e978d8b2ee0e47afc0fcf4feb91283b0a2467c734f" }, "downloads": -1, "filename": "basin_setup-0.12.1.tar.gz", "has_sig": false, "md5_digest": "fc93e7f36187204bdd66a6294c304115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37552, "upload_time": "2019-09-24T20:58:34", "url": "https://files.pythonhosted.org/packages/28/22/2ff2fcde7c201d9e26aa1e1e17b4860f42f5960cd6eca12b719f28ffc541/basin_setup-0.12.1.tar.gz" } ], "0.12.2": [ { "comment_text": "", "digests": { "md5": "282596c85c0a829e2ceca5a9d16f0aa2", "sha256": "5e099fa08240057f91e3bf54dc8776f222876b472ab232f2670b8cf884182152" }, "downloads": -1, "filename": "basin_setup-0.12.2-py3-none-any.whl", "has_sig": false, "md5_digest": "282596c85c0a829e2ceca5a9d16f0aa2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 48345, "upload_time": "2019-09-30T21:28:57", "url": "https://files.pythonhosted.org/packages/09/b5/b2eed84f2b7a37ba25a629f73e5defc35bfa3d6a93872ef2f5aaef6a0cf3/basin_setup-0.12.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "596ae57266738f36445296d08b604057", "sha256": "0988e4eb35dbe683fb42707a1cd69d15fd4948fcd5b3e00ed6b86c5fcd077950" }, "downloads": -1, "filename": "basin_setup-0.12.2.tar.gz", "has_sig": false, "md5_digest": "596ae57266738f36445296d08b604057", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37575, "upload_time": "2019-09-30T21:28:59", "url": "https://files.pythonhosted.org/packages/48/e9/dcabab103ccc4e2423f9b4c803f2cc8d5f8811ab20d6c2fd6859d2387503/basin_setup-0.12.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "282596c85c0a829e2ceca5a9d16f0aa2", "sha256": "5e099fa08240057f91e3bf54dc8776f222876b472ab232f2670b8cf884182152" }, "downloads": -1, "filename": "basin_setup-0.12.2-py3-none-any.whl", "has_sig": false, "md5_digest": "282596c85c0a829e2ceca5a9d16f0aa2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 48345, "upload_time": "2019-09-30T21:28:57", "url": "https://files.pythonhosted.org/packages/09/b5/b2eed84f2b7a37ba25a629f73e5defc35bfa3d6a93872ef2f5aaef6a0cf3/basin_setup-0.12.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "596ae57266738f36445296d08b604057", "sha256": "0988e4eb35dbe683fb42707a1cd69d15fd4948fcd5b3e00ed6b86c5fcd077950" }, "downloads": -1, "filename": "basin_setup-0.12.2.tar.gz", "has_sig": false, "md5_digest": "596ae57266738f36445296d08b604057", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37575, "upload_time": "2019-09-30T21:28:59", "url": "https://files.pythonhosted.org/packages/48/e9/dcabab103ccc4e2423f9b4c803f2cc8d5f8811ab20d6c2fd6859d2387503/basin_setup-0.12.2.tar.gz" } ] }