Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 2.83 KB

README.md

File metadata and controls

72 lines (48 loc) · 2.83 KB

Tools for NGIAB data preparation

This repository contains tools for preparing data to run a next gen simulation using NGIAB. The tools allow you to select a catchment of interest on an interactive map, choose a date range, and prepare the data with just a few clicks!

map screenshot

What does this tool do?

This tool prepares data to run a next gen simulation by creating a run package that can be used with NGIAB. It picks default data sources, including the v20.1 hydrofabric and nwm retrospective v3 forcing data.

Requirements

  • This tool is officially supported on macOS or Ubuntu. To use it on Windows, please install WSL.
  • GDAL needs to be installed.
  • The 'ogr2ogr' command needs to work in your terminal.

sudo apt install gdal-bin will install gdal and ogr2ogr on ubuntu / wsl

Installation

To install and run the tool, follow these steps:

  1. Clone the repository:

    git clone https://github.com/CIROH-UA/NGIAB_data_preprocess
    cd NGIAB_data_preprocess
  2. Create a virtual environment and activate it:

    python3 -m venv env
    source env/bin/activate
  3. Install the tool:

    pip install -e .
  4. Run the map app:

    python -m map_app

The first time you run this command, it will download the hydrofabric and model parameter files from Lynker Spatial. If you already have them, place conus.gpkg and model_attributes.parquet into modules/data_sources/.

If step 4 does not work, run the following:

touch .dev
python -m map_app

This .dev file in the root folder disables the automatic browser opening so you will need to manually open http://localhost:5000 after running the python -m map_app command.

Usage

Running the command python -m map_app will open the app in a new browser tab. Alternatively, you can manually open it by going to http://localhost:5000 with the app running.

To use the tool:

  1. Select the catchment you're interested in on the map.
  2. Pick the time period you want to simulate.
  3. Click the following buttons in order:
    1. Create subset gpkg
    2. Create Forcing from Zarrs
    3. Create Realization

Once all the steps are finished, you can run NGIAB on the folder shown underneath the subset button.

Note: When using the tool, the output will be stored in the ./output/<your-first-catchment>/ folder. There is no overwrite protection on the folders.