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

  1. Ensure you have Docker and UV installed on your system.

  2. Clone the workshop repository:

    git clone https://github.com/skoriche/NGIAB-Calibration-DevCon25.git
    cd NGIAB-Calibration-DevCon25
    
  3. 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.

  1. 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
  2. Examine the created calibration directory structure:

    ls -la calibration/
    
  3. 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
  4. Check the observation data file:

    head calibration/obs_hourly_discharge.csv
    

Running the Calibration Process

  1. 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
  2. Monitor the calibration progress:

    tail -f calibration/Output/Calibration_Run/ngen_*/ngen.log
    
  3. Examine the calibration results after completion:

    ls -la calibration/Output/Calibration_Run/ngen_*/Plot_Iteration/
    
  4. 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:

  1. View the best parameters from the calibration:

    cat calibration/Output/Calibration_Run/ngen_*/*_params_iteration.csv | tail -n 1
    
  2. 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:

  1. Check the validation configuration:

    ls -la calibration/Output/Validation_Run/
    
  2. Run the validation:

    cd calibration/Output/Validation_Run/
    ./validation.sh
    
  3. Examine the validation results:

    ls -la Validation_Output/
    

Back to Home