-
Notifications
You must be signed in to change notification settings - Fork 11
2. Running StreamCat Scripts
JLuke edited this page Nov 27, 2023
·
5 revisions
The scripts make use of a Control Table to pass all the particular parameters to the two primary scripts:
In turn, these scripts rely on a generic functions in StreamCat_functions.py, and pathways as described by stream_cat_config.py , which will need to be formated and saved as .py to fit your directories
To generate the riparian buffers we used in StreamCat we used the code in RiparianBuffers.py
To generate percent full for catchments on the US border for point features, we used the code in border.py
After editing the control tables to provide necessary information, such as directory paths, the following steps will execute processes to generate new watershed metrics for the conterminous US. This example uses Conda format within Spyder IDE.
- Edit ControlTable_StreamCat and set desired layer's "run" column to 1. All other rows should be set to 0 in run column.
- Open a conda shell and type "activate StreamCat".
- At the conda shell type "spyder" to activate Spyder IDE.
- Open file selection in Spyder and select your project location
- Open "StreamCat.py" in the code editor
- Open "StreamCat_functions.py" and "stream_cat_config.py" as well
- Save stream_cat_config.py.template as .py in project folder
- Set LOCAL_DIR to the proper directory. (This will be your project folder)
- Ensure the LYR_DIR has proper directory (Normally the QA Complete Rasters). This will be .tif files that you have stored on local drive.
- Check the STREAMCAT_DIR is running through Streamcat Allocations_and_Accumulation folder. * This runs data through Streamcat first in the Allocation and Accumulation folder
- Check NHD_DIR is in your own local NHD folder
- Check STATES_FILE is your own local folder
- Set ACCUM_DIR to "(project file director)/accum_npy/"
- The first time running StreamCat.py, the accum_npy folder will need to be removed from project file. This folder will autopopulate with information and files
- OUT_DIR goes to local drive
- FINAL_DIR goes to FTP Staging Hydroregions
- Double check that only the metrics you want to run have a 1, all others have a zero
- Run StreamCat.py script
Once StreamCat.py has run
- Open Make_Final_Tables.py in editor
- These final tables will show up in the OUT_DIR from stream_cat_config.py
- Run Make_Final_Tables.py