Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
5bfc7af
add initial ReadTheDocs page
sclaw Aug 15, 2025
559a48a
update index
sclaw Aug 15, 2025
c589762
add pages to RTD
sclaw Aug 19, 2025
3afe469
update docs
sclaw Aug 20, 2025
d18a268
update readme and tech reference
sclaw Aug 26, 2025
ab22d9b
update gitignore for docs
sclaw Aug 28, 2025
9474145
continue doc work
sclaw Sep 18, 2025
c758f51
update documentation for formulation regionalization and parameter re…
sclaw Sep 22, 2025
53a8de8
Merge branch 'development' into slawson_NGWPC-6996
sclaw Sep 24, 2025
5e541c2
Merge branch 'development' into slawson_NGWPC-6996
sclaw Oct 27, 2025
9dd22b0
catch up docs for packaging updates
sclaw Oct 28, 2025
d13257e
spruce up docs
sclaw Oct 28, 2025
bd23768
add content for parreg tech ref
sclaw Oct 28, 2025
799b8ec
tidy docs
sclaw Oct 28, 2025
b2c6414
refactor for automated documentation builds
sclaw Oct 28, 2025
8bfce8c
update docs to quiet warnings and improve API reference
sclaw Nov 4, 2025
cb1bfab
fix logging
sclaw Nov 4, 2025
4493896
Merge branch 'development' into slawson_NGWPC-6996
sclaw Nov 4, 2025
d6d2312
clean up readme
sclaw Nov 6, 2025
157fa7a
updates to index.md
Nov 7, 2025
50b641b
updates to config schemas and documentation
Nov 10, 2025
ff08b5a
fix issue in documentation for dict[str, BaseModel] fields
Nov 14, 2025
53d55b2
Merge branch 'development' into yliu_NGWPC-8833
yuqiong77 Nov 14, 2025
2e9145d
Resolve merge conflicts
Nov 14, 2025
c36934f
Merge remote branch 'yliu_NGWPC-8833' into local branch
Nov 14, 2025
658fd61
Fix README from merging
Nov 14, 2025
d574125
add intro and TOC to config_builder page
Nov 14, 2025
e319b47
Set version pins for geopandas, shapely, pandas to match pending upda…
mxkpp Nov 14, 2025
14c8fbb
minor updates to schema page
Nov 15, 2025
4d195a6
Unify pydantic minimum version to currently latest patch release of 2.11
mxkpp Nov 16, 2025
29ab62a
update config builder index page
Nov 17, 2025
a20a285
add NGEN simulation to framework image
Nov 17, 2025
6d73be9
update to use load dot env instead of mounting s3
mdeshotel Nov 18, 2025
202eb60
fix nprocs log
mdeshotel Nov 18, 2025
d35f4da
use model_dump instead of __dict__for to_dict
mdeshotel Nov 18, 2025
e6ff2f0
add output docs & fix bugs
Nov 18, 2025
a532f1a
revert changes to conf.py that caused issues
Nov 18, 2025
59e0609
add ulimit -n 60000 to ngen call
mdeshotel Nov 19, 2025
abb2a1b
update paths in config
mdeshotel Nov 19, 2025
e8a71b8
fix path typo
mdeshotel Nov 19, 2025
5ac3c77
update parreg config
mdeshotel Nov 19, 2025
0dd7749
update readme
mdeshotel Nov 19, 2025
452eec8
update snow_17 path
mdeshotel Nov 21, 2025
b4deb91
extensive updates to docs
Nov 21, 2025
7a174fd
minor updates to parreg docs
Nov 21, 2025
1578705
updates to API
Nov 24, 2025
3fbaf67
fix formreg
mdeshotel Nov 24, 2025
e919f4d
reduce mounts
mdeshotel Nov 24, 2025
eb22c86
update paths
mdeshotel Nov 24, 2025
f4ee548
add dotenv to requirements
mdeshotel Nov 24, 2025
3ee48b1
fix typo in readme
mdeshotel Nov 25, 2025
be2afa2
fix typos
sclaw Nov 25, 2025
271bcf2
fix indentation
sclaw Nov 25, 2025
1ddee83
add deployment gh action for when github pages are enabled
sclaw Nov 25, 2025
eef0b09
Merge pull request #1 from NGWPC/yliu_NGWPC-8833
yuqiong77 Nov 25, 2025
014a182
Merge remote-tracking branch 'origin/development' into mdeshotel_NGWP…
Nov 25, 2025
41bd4c5
minor updates to parref tech reference
Nov 25, 2025
be1d923
fix typo in prereg tech reference
Nov 25, 2025
155f58e
Merge pull request #2 from NGWPC/mdeshotel_NGWPC-7004
yuqiong77 Nov 25, 2025
69f8a1f
Merge remote-tracking branch 'origin/development' into maxkipp-ngwpc-…
mxkpp Nov 25, 2025
5bf6785
changes to run parreg/formreg
Nov 25, 2025
6ce71c9
udpated region-mgr.sh to allow HTTPS for git cloning
miguelp1986 Nov 25, 2025
6cf2cb1
udpated region-mgr.sh to allow HTTPS for git cloning
miguelp1986 Nov 25, 2025
3202cd4
Merge pull request #3 from NGWPC/maxkipp-ngwpc-8941-upgrade-shapely-2
mxkpp Nov 26, 2025
815af7f
remove trailing comma in ProximityPairer class
miguelp1986 Nov 26, 2025
473fd9f
fix typo at end of funcs_dist.py
Nov 26, 2025
336caab
add cleaned configs folder
Nov 28, 2025
ce69259
remove old sample_files folder
Nov 28, 2025
56ead96
remove sample_files references
Nov 28, 2025
ddd86f5
revert back subset scripts for efficiency
Nov 28, 2025
47be068
fix typo in README
Nov 28, 2025
12afbbb
Merge pull request #4 from NGWPC/pena-9003
miguelp1986 Nov 28, 2025
11d70dd
adjust output sub dirs in confi files
Nov 28, 2025
4596957
update regionalization.py to run both formreg and parreg
Nov 28, 2025
c861a78
fix argument options for regionalization.py
Nov 28, 2025
6faabf4
correct function name typo
Nov 28, 2025
63d148f
fix output file path error
Nov 28, 2025
0864441
refactor expand_config_for_vpu
Nov 28, 2025
bba9b66
add docker files for region_rte
Nov 28, 2025
46b21f2
remove obsolete file run_formreg.py
Nov 28, 2025
2f8fc1a
add Docker files for ngen_rte
Dec 1, 2025
7d23dd5
add docker files for evval
Dec 1, 2025
f2552a2
update docker files for ngen
Dec 1, 2025
0f2094a
update docker files for region
Dec 1, 2025
d3eefe3
update config files for ngen and eval
Dec 1, 2025
b71cbc9
updates to build three separate images
Dec 1, 2025
512a986
updates to remove imports from nwm-region-mgr for NGEN run
Dec 1, 2025
e6c977f
add help texts for options in the workflow
Dec 2, 2025
3307634
updates to README on docker image build
Dec 2, 2025
2cc215a
Merge pull request #6 from NGWPC/development
cmaynard-ngwpc Dec 3, 2025
c589a42
Merge pull request #7 from NGWPC/ngwpc-candidate
cmaynard-ngwpc Dec 4, 2025
4fd9352
remove unused obsolete code in plot_outputs.py
Dec 5, 2025
2e4526e
Disable fallback for nwm_routing (t-route), expose enablement as a ne…
mxkpp Dec 8, 2025
e84885e
fix vpu_gdf for plotting spatial maps
Dec 10, 2025
7094ec3
remove obsolete files
Dec 11, 2025
d6706c9
update README
Dec 11, 2025
f76e823
update config files to facilitate easy testing of entire workflow
Dec 11, 2025
c419703
updates to documentation
Dec 11, 2025
8e075ce
remove get_formulation_file_name
Dec 12, 2025
682efae
updates to use global timestamp formats
Dec 12, 2025
a082453
update add_entry_if_missing and docstring
Dec 12, 2025
d1660e1
update subset scripts
Dec 12, 2025
d680c77
ensure mode for regionalization is valid
Dec 12, 2025
1aec812
added type hine for config in substitute_placeholders
Dec 12, 2025
7ab2944
change default nprocs to -1 for config_ngen.yaml
Dec 12, 2025
c54808a
update README
Dec 12, 2025
7e567e7
remove random file utils/cfu
Dec 12, 2025
88a355e
remove obsolete file region-mgr.sh
Dec 12, 2025
3dc1ae8
Merge pull request #5 from NGWPC/yliu_test_old_image
yuqiong77 Dec 12, 2025
7438ee9
updates to increase memory efficiency in distance matrix calculation …
Dec 18, 2025
7c9da72
updates to generate plots of regionalized parameters
Dec 18, 2025
9602cfa
fix issue with buffer_size=0 and calib_basins_only=True
Dec 22, 2025
d8c387c
fix bug in select_formulation_donors_only
Dec 22, 2025
bf0a448
Merge pull request #8 from NGWPC/yliu_NGWPC-9205_resolve_bugs
yuqiong77 Dec 24, 2025
152584e
update config files
Dec 24, 2025
90a280f
update docs to add user's guide
Dec 24, 2025
7bdc2ef
updates to docs and README on local regionalization runs
Jan 5, 2026
1d50a7f
correct sample config generation
Jan 5, 2026
2ab82cc
add spatial maps of regionalized parameters to docs
Jan 5, 2026
146e2bd
updates to ensure vpu_list is consistent with domain in config
Jan 7, 2026
a55cff5
change exeption to warning to avoid erroring out
Jan 7, 2026
fca3e1a
updates to support formulation selection in AK
Jan 7, 2026
1dc3751
add util script for creating ngen/huc12 crosswalk for all domains
Jan 8, 2026
0ad144a
minor updates to computing streamcat attrs
Jan 8, 2026
1bd8fb2
fix bug when no donors available in a snow group
Jan 8, 2026
467ee97
add comments for oCONUS domains
Jan 8, 2026
3a7f5be
added notes about attributes and snowiness in FAQ
Jan 8, 2026
3e05577
updates to support using proximity algorithm
Jan 9, 2026
07ad501
add link to Confluence doc for verification to users guide
Jan 9, 2026
03502f8
Merge pull request #9 from NGWPC/yliu_NGWPC-9206_update_docs
yuqiong77 Jan 12, 2026
087d7bd
additional minor updates to docs/configs
Jan 12, 2026
0f6dbc3
Merge pull request #10 from NGWPC/yliu_NGWPC-9206_add_updates
yuqiong77 Jan 12, 2026
cad62ef
update users guide with info from Miguel
Jan 13, 2026
f8fb5b6
Merge pull request #11 from NGWPC/yliu_NGWPC-9204
yuqiong77 Jan 13, 2026
2884812
Merge pull request #12 from NGWPC/development
cmaynard-ngwpc Jan 21, 2026
399e8e5
Merge pull request #16 from NGWPC/ngwpc-candidate
cmaynard-ngwpc Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: documentation

on:
push:
branches: [ "documentation" ]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -r docs/source/requirements.txt
pip install .
- name: Debug Python imports
run: |
python -c "import nwm_region_mgr.parreg.config_schema; print('Import OK')"
- name: Sphinx build
run: |
sphinx-build docs/source docs/build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/build/
force_orphan: true
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ __pycache__/
# Editor configs
.vscode/

# Documentation
docs/build/*
docs/source/API/*
!docs/source/API/index.rst
# Specific project paths
pkgs/parreg/build
pkgs/parreg/tests/test_data/test_outputs
nwm-rte
nwm-rte
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright 2025 Raytheon Company

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

Licensed under: https://opensource.org/license/bsd-2-clause

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

All rights reserved. Based on Government sponsored work under contract GS-35F-204GA.

-----------------
156 changes: 73 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,105 @@
# nwm-region-mgr
# Formulation and Parameter Regionalization for the NextGen Framework
[![Build](https://img.shields.io/github/actions/workflow/status/ngwpc/nwm-region-mgr/ci.yaml?branch=main)](.github/workflows/ci.yml)
[![License: BSD 2-Clause](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/license/bsd-2-clause)
[![Release](https://img.shields.io/github/v/release/ngwpc/nwm-region-mgr)](https://github.com/NGWPC/nwm-region-mgr)
![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-orange.svg)
![Linter: Ruff](https://img.shields.io/badge/linter-ruff-orange)

## Name
NGEN/NWM Regionalization
<img src="docs/source/_images/overview.png" alt="overview" width="600"/>

## Description
This repository includes packages for conducting formulation and parameter regionalizations for NextGen modules,
as well as scripts/workflows to run ngen simulations and evaluation.
- parreg: parameter regionalization
- formreg: formulation regionalization
- utils: utility functions shared by parreg and formreg

`nwm_region_mgr` is a Python package for identifying optimal model formulations and parameter values in ungauged catchments. It leverages calibration data from gauged catchments and catchment attributes to improve hydrologic modeling and forecasting skill across regions, playing a key role in the NextGen and NWM ecosystem.


## Key Features

- **Formulation Regionalization** – Ranks NextGen model formulations for ungauged catchments based on performance at gauged sites in a region.
- **Parameter Regionalization** – Estimates parameter values by intelligently transferring calibrations across catchments based on similarity.
- **Clustering Methods** – Groups catchments with shared hydrologic characteristics using multiple clustering approaches.
- **Distance methods** – Identify donors using distance metrics that characterize catchment similarity/dissimilarity.
- **Diagnostic Plots** – Generates diagnostic plots and maps that explain formulation and parameter choices.
- **Scalable Workflows** – Efficiently supports studies from individual watersheds to CONUS-wide applications.
- **Customizable Configurations** – Full control of workflows via human-readable config files.

## Docker Run Time Environment (RTE)
### Step 0. Build Docker image
`Note` This step is only necessary if a docker image doesn't already exists or if updates to the code base have been implemented. The short flag `-d` can also be used in place of `--docker`
### Step 0. Build Docker images and download data
Follow NMW-RTE [README](https://github.com/NGWPC/nwm-rte/blob/development/README.md) to build Docker images and download sample data.

> **Note:** A single ngen RTE Docker image needs to be built before continuing to the regionalization steps below.
> Make sure that RTE's build script runs successfully. RTE's default run script (for forecasting) is not used by the regionalization workflow and should be skipped.

```bash
cd nwm-region-mgr
```
```bash
./region-mgr.sh -docker
```
### Step 1. Run regionalization
#### a) Run both formulation and parameter regionalization together:

First, navigate to nwm-rte directory, e.g.,
```bash
./region-mgr.sh --formreg --parreg
cd ~/ngwpc/nwm-rte
```
#### b) Run formulation regionalization alone:
The short flag `-f` can also be used in place of `--formreg`.

#### a) Run formulation regionalization alone (no parreg):
The short flag `-f` can also be used in place of `--formreg`. Prior to running, configure the settings in `configs/config_general.yaml` and `configs/config_formreg.yaml`.
```bash
./region-mgr.sh --formreg
time ./ngen_rte_run_region.sh --formreg
```
#### c) Run parameter regionalization alone:
The short flag `-p` can also be used in place of `--parreg`.
Typically this step can be skipped since parameter regionalization also runs formulation regionalization as a prerequisite.

#### b) Run parameter regionalization (formreg is also ran as a prerequisite):
The short flag `-p` can also be used in place of `--parreg`. Prior to running, configure the settings in `configs/config_general.yaml`, `configs/config_formreg.yaml` and `configs/config_parreg.yaml`.
```bash
./region-mgr.sh --parreg
time ./ngen_rte_run_region.sh --parreg
```
### Step 2. Run NGEN
Run a NGEN simulation:

The short flag `-n` can also be used in place of `--ngen`.
The short flag `-n` can also be used in place of `--ngen`. Prior to running, configure the settings in `configs/config_ngen.yaml`.
```bash
./region-mgr.sh --ngen
time ./ngen_rte_run_region.sh --ngen
```
### Step 3. Run Evaluation
Run an evaluation:

The short flag `-e` can also be used in place of `--eval`.
The short flag `-e` can also be used in place of `--eval`. Prior to running, configure the settings in `configs/config_eval.yaml`.
```bash
./region-mgr.sh --eval
time ./ngen_rte_run_region.sh --eval
```
### Steps 0-4
Alternatively the user can run steps 0-4 in all at once in series:

### To run all steps in one command
```bash
./region-mgr.sh -dfpne
time ./ngen_rte_run_region.sh --parreg --ngen --eval
```
## Desktop Run Time Environment (RTE)

## Desktop/Workspace
### Clone & Build

#### 1. clone ngen-region-mgr from Github

```bash
cd [NGEN_REG_ROOT]
git clone -b development --recurse-submodules https://github.com/NGWPC/nwm-region-mgr.git
git clone https://github.com/NGWPC/nwm-region-mgr.git
cd nwm-region-mgr
```

#### 2. create python venv

Create a virtual environment to isolate the dependencies of this library from your base Python environment.
```bash
cd [VENV_ROOT]
/usr/bin/python3.11 -m venv venv
source venv/bin/activate
python3.11 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
```

#### 3. install nwm-region-mgr

You will then be able to install nwm_region_mgr. There are a few variants that users may be interested in.

```bash
cd [NGEN_REG_ROOT]
pip install . # to install formreg and utils only
# OR
pip install .[parreg] # to install formreg, utils, and parreg
# Regular package install
pip install .
# Install the package in edit mode (for development)
pip install -e .
# Install additional dependencies for parameter regionalization
pip install .[parreg]
# Install dependencies for docs and dev
pip install .[docs,dev]
```

where [VENV_ROOT] and [NGEN_REG_ROOT] refer to the directory to install python venv and nwm-region-mgr
in your local workspace, respectively


### STEP 1: Run regionalization to produce regionalized parameters and formulations

#### 1) Set up configuration yaml files
Expand All @@ -94,55 +109,30 @@ Three yaml config files are needed to run regionalization
- **onfig_formreg.yaml**: specific settings for the formulation regionalization process.
- **config_parreg.yaml**: specific settings for the parameter regionalization process.

Follow the sample [config files](https://github.com/NGWPC/nwm-region-mgr/tree/development/sample_files/configs) to set up the configurations for your regionalization application as needed.

Sample input data can be downloaded from **s3://ngwpc-dev/Yuqiong.Liu/repos/nwm-region-mgr**
Follow the sample config files (nwm_region_mgr/configs) to set up the configurations
for your regionalization application as needed.

Sample input data can be downloaded from **s3://ngwpc-dev/regionalization/inputs**

#### 2) Run the regionalization script

```bash
python [NGEN_REG_ROOT]/nwm-region-mgr/regionalization.py [COFIG_DIR]
python [NGEN_REG_ROOT]/nwm-region-mgr/regionalization.py [COFIG_DIR] [REG_TYPE]
```
Where:
Where:
- [NGEN_REG_ROOT] refers to the directory where nwm-region-mgr is installed
- [COFIG_DIR] refers to the directory containing the three config files as noted in 1), e.g.,
- [REG_TYPE] refers to the type of regionalization to run, either 'formreg' (formulation regionalization only) or 'region' (parameter regionalization, which also runs formulation regionalization first if not done already). If not specified, the default is 'region'.

```bash
python regionalization.py sample_files/configs
python regionalization.py configs formreg # to run formulation regionalization only
python regionalization.py configs region # to run parameter regionalization (and formulation regionalization if not done already)
```

### STEP 2: Run NGEN simulation with regionalized parameters

- #### Run natively in workspace
- ##### 1) Install [ngen](https://github.com/NGWPC/ngen) and all submodules in its own venv
You may want to follow the following Confluence pages:
- [Clone ngen](https://confluence.nextgenwaterprediction.com/display/NGWPC/Clone+NGWPC+GitHub+Code)
- [Build ngen](https://confluence.nextgenwaterprediction.com/display/NGWPC/Build+ngen+completely)

- ##### 2) Install [mswm](https://github.com/NGWPC/nwm-msw-mgr) in its own venv

- ##### 3) Activate MSWM venv, e.g.
```bash
source ~/repos/nwm-msw-mgr/venv/bin/activate
```
- ##### 4) Set up MSWM configuration as shown in [run_ngen_vpu.sh](https://github.com/NGWPC/nwm-region-mgr/blob/development/run_ngen_vpu.sh)

- ##### 5) Run MSWM and ngen simulation
```bash
cd ~/repos/nwm-region-mgr
./run_ngen_vpu.sh
```
- ##### 6) Check inputs, outputs and logs
All input, output and log files from running MSWM and NGEN can be found in *[work_dir]/regionalization/[run_name]/[vpu]*
(as defined in **run_ngen_vpu.sh**)

- ##### 7) If ngen fails at t-route
Check if all NGEN cat-*.csv and nex-*.csv output files are generated; if yes,
run t-route separately from the Output directory where ngen outputs are located, e.g.,
```bash
python -m nwm_routing -f -V4 ../Input/vpu_09_troute_config_region.yaml
```
To void complications from building ngen and its submodules locally, we recommend you always run NGEN simulation
with regionalized parameters and formulations from a Docker container. Follow instructions from the **Docker Run Time Environment (RTE)** section above.

### STEP 3: Evaluate NGEN simulation with nwm.verf

Expand All @@ -154,7 +144,7 @@ Follow example config at [config_eval.yaml](https://github.com/NGWPC/nwm-region-

Check out what metrics are currently supported [here](https://confluence.nextgenwaterprediction.com/display/NGWPC/Forecast+Verification+%28ngen-verf%29%3A+Configuration)

Sample input data can be downloaded from **s3://ngwpc-dev/Yuqiong.Liu/repos/nwm-verf** and are also available in [Github](https://github.com/NGWPC/nwm-verf/tree/development/data)
Sample input data can be downloaded from **s3://ngwpc-dev/regionalization/data/inputs/eval**

#### 3) Activate venv for nwm.verf
```bash
Expand Down
28 changes: 15 additions & 13 deletions sample_files/configs/config_eval.yaml → configs/config_eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,27 @@ general:
compute_metrics: true
plot_metrics: true
domain: conus # Define NWM domain. Supported options: conus, ak, hi, prvi
location_set_name: vpu_09 # user-specified name for the set of locations
location_set_name: vpu_03S # user-specified name for the set of locations
location_type: usgs_gage # location type
variable_name: streamflow # currently only 'streamflow' is supported
nwm_configuration: ngen_simulation
dataset_name: [hdbscan] # user-specified name of datasets (e.g., formualtion or algorithm name)
nwm_version: [ngen, ngen] # list of NWM versions; must have the same length as 'dataset_name'
forecast_start_date: ['2022-10-01 00:00:00', '2022-10-01 00:00:00'] # list of start dates for simulation; must be same length as 'dataset_name'
forecast_end_date: ['2022-10-01 10:00:00', '2022-10-01 10:00:00'] # list of end dates for simulation; must be same length as 'dataset_name'
eval_start_date: ['2022-10-01 03:00:00', '2022-10-01 03:00:00'] # start date for evaluation period
eval_end_date: ['2022-10-01 10:00:00', '2022-10-01 10:00:00'] # end date for evaluation period
dataset_name: [test_kmeans] # user-specified name of datasets (e.g., formualtion or algorithm name)
nwm_version: [ngen] # list of NWM versions; must have the same length as 'dataset_name'
forecast_start_date: ['2022-10-01 00:00:00'] # list of start dates for simulation; must be same length as 'dataset_name'
forecast_end_date: ['2022-10-01 10:00:00'] # list of end dates for simulation; must be same length as 'dataset_name'
eval_start_date: ['2022-10-01 03:00:00'] # start date for evaluation period
eval_end_date: ['2022-10-01 10:00:00'] # end date for evaluation period
separate_calibrated: True # whether to distinguish calibrated and regionalized locations in the evaluation

#### configurations for various file paths
file_paths:
base_dir: ngen-app/nwm-region-mgr/data/nwm-verf/data # root directory to store data/outputs for verification
location_list_file: '{base_dir}/inputs/regionalization/gage_list_conus_{location_set_name}.csv' # text file containing list of usgs gage IDs (one gage ID per line)
gage_hydrofabric_file: '{base_dir}/inputs/gage_files/gage_hydrofabric_all_domains.parquet' # gage hydrofabric file (including geometry)
crosswalk_file: '{base_dir}/inputs/regionalization/usgs_{nwm_version}_crosswalk_{domain}.parquet' # crosswalk file mapping gage IDs to NWM/ngen link IDs
fcst_data_file: 'ngen-app/nwm-region-mgr/data/regionalization/{dataset_name}/{location_set_name}/Output/troute_output_{forecast_start_date}.nc' # forecast data directory (must be specified when nwm_forecast.data_source is set to ngenCERF)
output_dir: '{base_dir}/outputs/{location_set_name}' # output directory to store all output datasets, metrics and plots
#base_dir: data # when running from local
base_dir: /ngen-app/nwm-region-mgr/data/ # root directory to store inputs/outputs for verification
location_list_file: '{base_dir}/inputs/eval/gage_list_conus_{location_set_name}.csv' # text file containing list of usgs gage IDs (one gage ID per line)
crosswalk_file: '{base_dir}/inputs/eval/usgs_{nwm_version}_crosswalk_{domain}.parquet' # crosswalk file mapping gage IDs to NWM/ngen link IDs
fcst_data_file: '{base_dir}/outputs/ngen/regionalization/{dataset_name}/{location_set_name}/Output/troute_output_{forecast_start_date}.nc' # forecast data directory (must be specified when nwm_forecast.data_source is set to ngenCERF)
calib_param_file: '{base_dir}/inputs/region/pseudo_calib_params/sampled_params_{domain}.csv' # calibration parameters file (used when separate_calibrated is True); must have column 'gage_id'
output_dir: '{base_dir}/outputs/eval/{location_set_name}' # output directory to store all output datasets, metrics and plots

nwm_forecast:
data_source: ngenSIM # Specifies the remote location from which to fetch the data ("GCS", "NOMADS", "DSTOR", "ngenCERF")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

# General settings for the formulation regionalization application
general:
huc12_hydrofabric_file: '{base_dir}/inputs/NHDPlusV21/NHDPlusNationalData/NationalWBDSnapshot.gdb'
divide_huc12_cwt_file: '{base_dir}/inputs/cwt_divide_huc12/cwt_divide_huc12_{domain}.csv' # Path to crosswalk file for HUC12 and NextGen catchments.
huc12_hydrofabric_file: '{base_dir}/inputs/region/NHDPlusV21/NHDPlusNationalData/NationalWBDSnapshot.gdb' #non-AK domains
#huc12_hydrofabric_file: '{base_dir}/inputs/region/NHDPlusV21/NHD_H_Alaska_State_GPKG.gpkg' # AK domain
divide_huc12_cwt_file: '{base_dir}/inputs/region/cwt_divide_huc12/cwt_divide_huc12_{domain}.csv' # Path to crosswalk file for HUC12 and NextGen catchments.

calib_basins_only: False # whether to run formulation selection only for calibrated basins (based on summary score)
formulation_to_include: # List of competing formulations required to be considered in the selection process
Expand Down Expand Up @@ -63,7 +64,7 @@ summary_score:
formulation_cost:

#score_tolerance: 0.05 # Tolerance in percentage for summary score.
file: '{base_dir}/inputs/formulation_costs_secs_per_catchment.csv' # Path to the file containing the computational cost of each formulation
file: '{base_dir}/inputs/region/formulation_costs_secs_per_catchment.csv' # Path to the file containing the computational cost of each formulation
costs: # List of formulations and their corresponding computational costs
"noah-owp-modular ueb cfe-x t-route": 10
# "noah-owp-modular sac-sma t-route": 20
Expand All @@ -76,7 +77,7 @@ output:

formulation: # Output configurations for the selected formulations
save: True
path: '{base_dir}/outputs/{run_name}/formulations'
path: '{base_dir}/outputs/region/{run_name}/formulations'
stem: 'form_{domain}_vpu{vpu_list}'
stem_suffix: '_pars' # suffix for the formulation file with parameters
format: parquet
Expand All @@ -86,11 +87,11 @@ output:

config_final: # Final configuration file after processing and validation
save: True
path: '{base_dir}/outputs/{run_name}/config_formreg_final.yaml'
path: '{base_dir}/outputs/region/{run_name}/config_formreg_final.yaml'

summary_score: # Output configurations for the summary score
save: True
path: '{base_dir}/outputs/{run_name}/summary_score'
path: '{base_dir}/outputs/region/{run_name}/summary_score'
stem: 'score_{domain}_vpu{vpu_list}'
stem_suffix: '_all_gages' # suffix for the summary score file containing all gages in the domain
format: parquet
Expand Down
Loading