Task 6: Add the Script to Time Series Icons
Add the Script to a Time Series Icon
Now that the plot script is working as intended, you can associate the script to any time series icon that you wish.
- Open the Script Editor.
- Edit the script and comment out line 29 by inserting a # character (or using the Control+/).
- Save the script.
- Exit and restart the CAVI.
- The restart is required to flush the previously-defined variable from the system.
- Open the Workshop_HEC_RussianRiver watershed and the CWMS Graphics and Scripting forecast.
- Run the script again. You should get the same error as earlier.
- Open the Script Editor and copy the filename for the Stage+Flow script to the clipboard.
- Close the Script Editor.
- Switch to the Setup tab.
- Right-click on the Calpella Time Series Icon and select Edit.
- Select the Scripts/HTML tab in the Time Series Icon Editor dialog.
- Enter Stage+Flow for the Display Name.
- Paste the filename from earlier (C:\CWMS_Class\watershed\Workshop_HEC_RussianRiver\scripts\Stage+Flow.py) into the Script File or Other field.
- Populate the Arguments field.
- Enter the following. Ensure that datasetList is exactly as shown, with the capital L, but without the line break after the comma. You can copy this string from line 29 in the script or from the ScriptArguments.txt file in the watershed's shared directory.
datasetList="/EF RUSSIAN R/CALPELLA CA/STAGE//15Minute/USGS/,/EF RUSSIAN R/CALPELLA CA/FLOW//15Minute/USGS/"
- Enter the following. Ensure that datasetList is exactly as shown, with the capital L, but without the line break after the comma. You can copy this string from line 29 in the script or from the ScriptArguments.txt file in the watershed's shared directory.
- Check the box under the Modeling tab only, and click the Apply and OK buttons.
- Return to the Modeling tab.
Right-click on the Calpella Time Series Icon and select Run Stage+Flow to run the script.
- The plot should look like the one created at the end of Task 5.
- Repeat steps 10 through 17 for the Ukiah, Talmage, and Hopland Time Series Icons.
- Use the following for the datasetList for the various icons. The text below can be found in the ScriptArguments.txt file in the watershed's shared directory in case you would like to copy/paste instead of type.
Ukiah:
datasetList="/RUSSIAN R/UKIAH CA/STAGE//15Minute/USGS/,/RUSSIAN R/UKIAH CA/FLOW//15Minute/USGS/"
Talmage:
datasetList="/RUSSIAN R/TALMAGE CA/STAGE//15Minute/USGS/,/RUSSIAN R/TALMAGE CA/FLOW//15Minute/USGS/"
Hopland:
datasetList="/RUSSIAN R/HOPLAND CA/STAGE//15Minute/USGS/,/RUSSIAN R/HOPLAND CA/FLOW//15Minute/USGS/"
Calpella:
datasetList="/EF RUSSIAN R/CALPELLA CA/STAGE//15Minute/USGS/,/EF RUSSIAN R/CALPELLA CA/FLOW//15Minute/USGS/"
- Use the following for the datasetList for the various icons. The text below can be found in the ScriptArguments.txt file in the watershed's shared directory in case you would like to copy/paste instead of type.