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. 

  1. Open the Script Editor.
  2. Edit the script and comment out line 29 by inserting a # character (or using the Control+/).
    Stage + Flow Script
  3. Save the script.
  4. Exit and restart the CAVI.
    1. The restart is required to flush the previously-defined variable from the system.
  5. Open the Workshop_HEC_RussianRiver watershed and the CWMS Graphics and Scripting forecast.
  6. Run the script again. You should get the same error as earlier.
  7. Open the Script Editor and copy the filename for the Stage+Flow script to the clipboard.
  8. Close the Script  Editor.
  9. Switch to the Setup tab.
  10. Right-click on the Calpella Time Series Icon and select Edit.
  11. Select the Scripts/HTML tab in the Time Series Icon Editor dialog.
  12. Enter Stage+Flow for the Display Name.
  13. Paste the filename from earlier (C:\CWMS_Class\watershed\Workshop_HEC_RussianRiver\scripts\Stage+Flow.py) into the Script File or Other field.
  14. Populate the Arguments field.
    1. 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/"
  15. Check the box under the Modeling tab only, and click the Apply and OK buttons.
    Time Series Icon Editor 
  16. Return to the Modeling tab.
  17. Right-click on the Calpella Time Series Icon and select Run Stage+Flow to run the script.
    Select Script from Map Window

  18. The plot should look like the one created at the end of Task 5.
  19. Repeat steps 10 through 17 for the Ukiah, Talmage, and Hopland Time Series Icons.
    1. 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/"