Development Tasks / Deploy
The software that is created and tested in the development environment via the PyCharm IDE must be deployed to the operational environment, which does not include PyCharm.
1. Clone the Repository
Clone the Colorado's Decision Support System (CDSS) Snow Data Assimilation System (SNODAS) Tools from GitHub. Step-by-step instructions, provided by GitHub Help, are listed below.
- Open Git Bash.
- Change the current working directory to the location where you want the cloned directory to be made.
- Type
git clone
and then typehttps://github.com/OpenWaterFoundation/cdss-app-snodas-tools.git
. - Press
Enter
. The repository clone will be created.
2. Create Folder/File Structure for Deployed Environment
- Determine/create the location on the local computer for the deployed version of the SNODAS Tools. Name this folder
SNODAS_Tools
. - Create the following folders under the
SNODAS_Tools
folder.
aws
config
scripts
staticData\WatershedConnectivity
processedData
TSTool\6_CreateTimeSeriesProducts\SnowpackGraphsByBasin-tsp
- Move the following files from the repository to the deployed environment.
File in Repository |
Location in Deployed Environment |
---|---|
pycharm-project\ SNODAS_utilities.py |
SNODAS_Tools\ scripts |
pycharm-project\ SNODASDaily_Automated.py |
SNODAS_Tools\ scripts |
pycharm-project\ SNODASDaily_Interactive.py |
SNODAS_Tools\ scripts |
pycharm-project\ SNODASDaily_Automated_forTaskScheduler.bat |
SNODAS_Tools\ scripts |
test-CDSS\ aws\ copyAllToOwfAmazonS3.bat |
SNODAS_Tools\ aws |
test-CDSS\ config\ SNODAS-Tools-Config.ini |
SNODAS_Tools\ config |
test-CDSS\ staticData\ CO_Basins_Albers.shp (and other extensions) |
SNODAS_Tools\ staticData |
test-CDSS\ staticData\ WatershedConnectivity\ Watershed_Connectivity_v3.xlsx |
SNODAS_Tools\ staticData\ WatershedConnectivity |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ create-snodas-swe-graphs.TSTool |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ create-snodas-swe-graphs-tstool-control.txt |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ snodas-localid-snowcover-graph-template.tsp |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ snodas-localid-swe-graph-template.tsp |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ snodas-localid-swe-volume-1weekchange-graph-template.tsp |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ snodas-localid-swe-volume-gain-cumulative-graph-template.tsp |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
test-CDSS\ TsTool\ 6_CreateTimeSeriesProducts\ snodas-localid-swe-volume-graph-template.tsp |
SNODAS_Tools\ TSTool\ 6_CreateTimeSeriesProducts |
3. Set Variables in the Configuration File
- Open the configuration file
SNODAS_Tools\config\SNODAS-Tools-Config.ini
in the deployed environment. - Change all setttings in the configuration file. Settings are explained as comments inside the configuration file as well as in the File Structure section of the Developer Documentation.
- Make sure that the relative path in section
handler_fileHandler
optionargs
is set to the location where you want the log file to be stored. Recommend that the relative path is set to..\processedData\SNODASTools.log
.
4. Set Variables in the Task Scheduler Batch File
- Open the task scheduler batch file
SNODAS_Tools\scripts\copyAllToOwfAmazonS3.bat
in the deployed environment. - Change
OSGEO4W_ROOT
to point to the base OSGEO4W install folder. - Change
PYCHARM
to point to the pycharm program. - Change
PYTHON_JOB
to point to theSNODASDaily_Automated.py
script in the deployed environment.
5. Set Variables in the Python Scripts
- Open the SNODAS_utilities.py script
SNODAS_Tools\scripts\SNODAS_utilities.py
in the deployed environment. - Change
Configfile
to the relative path of the configuration fileSNODAS_Tools\config\SNODAS-Tools-Config.ini
. - Do the same for the SNODASDaily_Automated.py
SNODAS_Tools\scripts\SNODASDaily_Automated.py
and the SNODASDaily_Interactive.pySNODAS_Tools\scripts\SNODASDaily_Interactive.py
.