Introduction

This workshop demonstrates some advanced topics in scripting and plotting. Although the script runs without modification, you will have the opportunity to explore changing the script to produce the plot of your choice.

The files referenced in this workshop are included in the ZIP package below.

Customizing HEC-DSSVue.zip


Customizing HEC-DSSVue.zip.

ReservoirPlot2.txt


NOTE: The script expects the file to be extracted to the C:\Class\DSS directory, If you extract it to another directory you will have to modify line 10 of the script to specify the correct directory of the HEC-DSS file name before running the script in step 2 below.


Task 1. Create a Reservoir Plot script

  1. Open the file named CustomizingDSSVueWorkshopData.dss in the workshop directory.
    1. If you have other DSS files opened, make sure the tab for CustomizingDSSVueWorkshopData.dss is selected
  2. Create a new script named ReservoirPlot and populate it with the contents of the ReservoirPlot.txt file in the workshop directory.
  3. Run the script.
    1. It should create plot as shown

      4. The script also creates an image file in the workshop directory.

    1. View the image file.


Task 2. Analyze the Script

Question 1. How does the script get the DSS file name?

A string containing the file path is assigned to the variable dssFilename on line 12 of the script.

 Question 2. How is the precipitation data read differently from the DSS file than the other data, and why?

The precipitation data is read using the read method instead of the get method. This is so that a TimeSeriesMath object is returned, which is needed to compute incremental precipitation from the cumulative precipitation.

 Question 3. What are the viewport weights used in the script?

 Top viewport = 10, middle viewport = 45, bottom viewport = 45

Question 4. What is the value passed to the setReversed() method for the precip axis?

False

Question 5. Run the script with and without the storViewport.scaleAxisFromOpposite("Y2") line commented out. What is the difference?

Without storViewport.scaleAxisFromOpposite("Y2"), the Stor curve fills more of the viewport, but the grid increments (22,500 ac-ft) are difficult to interpolate between.

With storViewport.scaleAxisFromOpposite("Y2"), the Stor curve fills less of the viewport, but the grid increments (50,000 ac-ft) are easier to interpolate between.

Question 6. What is the specified size of the plot image file ReservoirPlot.png generated by the script?

 1200 x 600 pixels


Task 4. Modify the Line and Fill Properties

  1. Open HEC-DSSVue’s online help
    1. Press F1 or select Help→Help from the HEC-DSSVue menu
    2. or navigate to Plotting in your browser).
  2. Expand the Scripting DSSVue item
  3. Select the Plot Component Properties link
  4. Modify the script by replacing some of the line and fill properties in the script with those listed in the various property categories. 
  5. Re-run the script and view the changes on-screen and in the image file.

Task 5. Add a Maximum Storage Marker

  1. Using the maximum elevation marker as a guide, add a maximum storage marker.
  2. Place the marker line on the Y2 axis
  3. Put the label on the right side of the viewport.