step by step instructions - JoshCu/NGIAB-Calibration-DevCon25 GitHub Wiki
Step-by-Step Instructions
This section guides you through the calibration workshop using the provided datasets and Docker images.
Setting Up Your Environment
-
Clone the workshop repository:
git clone https://github.com/skoriche/NGIAB-Calibration-DevCon25.git cd NGIAB-Calibration-DevCon25
-
Navigate to the workshop data directory:
cd Data/Provo_River
Creating a Calibration Configuration
For this workshop, we'll be using data for USGS gauge 10154200 (Provo River). The data package has already been prepared for you.
-
Create a calibration configuration using the
ngiab-cal
tool:uvx ngiab-cal . -g 10154200
This command will:
- Create a
calibration
directory - Copy and prepare the necessary configuration files
- Set up the observation data file
- Create a
-
Examine the created calibration directory structure:
ls -la calibration/
-
Open and review the
ngen_cal_conf.yaml
file in the calibration directory:less calibration/ngen_cal_conf.yaml
This file contains the calibration settings, including:
- Parameter ranges
- Objective function settings
- Paths to observation data
- Iterations count
- Time periods for calibration
-
Check the observation data file:
head calibration/obs_hourly_discharge.csv
Running the Calibration Process
-
Run the calibration with 50 iterations:
uvx ngiab-cal . -g 10154200 --run -i 50
This will:
- Start the Docker container with the calibration environment
- Execute the calibration process
- Store outputs in the calibration/Output directory
-
Monitor the calibration progress:
tail -f calibration/Output/Calibration_Run/ngen_*/ngen.log
-
Examine the calibration results after completion:
ls -la calibration/Output/Calibration_Run/ngen_*/Plot_Iteration/
-
The plots in this directory show the progress of the calibration, including:
- Parameter values over iterations
- Objective function improvements
- Hydrograph comparisons
- Flow duration curves
Applying Calibrated Parameters
Once the calibration is complete, you can copy the calibrated parameters back to your model configuration:
-
View the best parameters from the calibration:
cat calibration/Output/Calibration_Run/ngen_*/*_params_iteration.csv | tail -n 1
-
The calibration process creates a
calibrated_params.json
file that can be used for future model runs:ls -la config/ cat config/calibrated_params.json
Validation Run
After calibration, you can run a validation using the calibrated parameters:
-
Check the validation configuration:
ls -la calibration/Output/Validation_Run/
-
Run the validation:
cd calibration/Output/Validation_Run/ ./validation.sh
-
Examine the validation results:
ls -la Validation_Output/