Run the Diversion-Runoff Calculator
Run the Diversion-Runoff Calculator
After acquiring the necessary UCRAF-DST files and configuring a Python environment, the user is ready to run the Diversion-Runoff Calculator (DRC). The DRC aggregates remotely sensed crop consumptive use to estimate diversion demands. A single file called 'ObservedAndDRCDiverisions.xlsx' is generated to supply the agricultural demands to the various RiverWare© models. This page describes how to run the DRC via ArcGIS Pro.
Note, it is possible to perform all the necessary functions outside of an ArcGIS environment, however, the process is more involved and requires a standalone Python environment.
Ensure the UCRAF Toolbox is added to the project. If not, perform the following steps.
Open a new project in ArcGIS Pro
Add the toolbox:
Catalog pane → right click on... "Toolboxes"
Navigate to: C:/UCRAF_ControlTool/ArcGIS/ArcToolbox/ (or whatever path leads to the UCRAF_ControlTool repo)
Select: UCRAF.atbx and hit 'OK'.
Add the UCRAF Toolbox (UCRAF.atbx) to the project in ArcGIS Pro.
The UCRAF Toolbox should now appear in the 'Catalog Pane'.
The DRC reads a text file that points to all the necessary files and specifies the mode of operation. This input file is paired with the DRC Python program (DiversionRunoffCalculator.py) in the working directory. The file can be created from scratch, or an existing input file can be modified to run any particular simulation. The structure of this main input file is described elsewhere.
The final DRC Controller Tool generates this file for the user. This ensures that the file is structured properly and verifies all the file paths/filenames. For this reason, the tool is recommended for initial setup. However, subsequent DRC simulations can be run with slight edits to this file that change the mode of operation or substitute one file for another.
To generate the main input text file and run the DRC, double click on the 'Run DRC' from the Project tab in the Catalog Pane:
Give the simulation a name. Specify the working directory from which you will run the DRC program. This is where the the DRC output will be written. Set the start and end years. Specify whether the current simulation is a baseline scenario or it represents some sort of change case and whether or not to aggregate the data for RiverWare©.
Next, step through each subsequent input parameter, identifying the individual files and feature layers to use for the simulation. Some parameters are optional. Those that are required are indicated with a red asterisk (*). After all the required fields are satisfied, hit the 'Run' button.
All the input data is contained in the 'UCRAF_Data' directory within the local 'UCRAF_ControlTools' repo aquired in Step 5 of the setup. Prior to running, ensure the files are up-to-date with a dvc pull command from the GitBash terminal.
Generate the main input file using the 'Generate DRC Input File' tool in the UCRAF Toolbox by specifying a simulation name, working directory, operation modes, supporting files, and the local DRC repository through the ArcGIS Geoprocessing Pane.
After all the required fields are satisfied, hit the 'Run' button. This will write the main input file into the working directory and call the python program. A python command window should open to view progress. After the program execution completes, the output is written to the working directory that was set.