udunits database from /usr/share/xml/udunits/udunits2.xml
This build of rgl does not include OpenGL functions. Use
rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).
udunits database from /usr/share/xml/udunits/udunits2.xml
This build of rgl does not include OpenGL functions. Use
rglwidget() to display results, e.g. via options(rgl.printRglwidget = TRUE).
The generation of flood inundation maps is expensive, technically demanding, and heavily dependent on geography and user specified inputs. With the advances of the National Water Model and geospatial approximations to the hydraulic sciences, the ability to generate flood inundation maps via a Height Above Nearest Drainage and Synthetic Rating Curve library was realized. This technique is used in NOAA Office of Water Prediction operational flood forecasting as the FIM4 HAND libraries sheparded by the National Water Center. See the repo and accompanying wiki for more details.
As one of the first methods of tying the National Water Model to a flood map, the once NFIE then CFIM > FIM2 > Cahaba (FIM3) > GMS (FIM4) codebase is the Office of Water Predictions default means of creating FIM libraries. This current iteration of the OWP HAND based FIM repo is written in Python, distributed as a docker’d environment, and is executed in AWS cloud services. This repo performs the steps needed to create a Hight Above Nearest Drainage (HAND) Relative Elevation model (REM) and Synthetic Rating Curve (SRC). As both a research and an operational toolchain, this repo furthermore serves as an accessible entry point to some of the more “modern” computational patterns and better practices, and can be deployed in a number of ways.
The most relevant stearing files are the /src/bash_variables.env
You enable HUCS with an inclusion in a list a la /data/inputs_huc_lists/testunit.lst
While there are “smart defaults” for many of the runtime arguments, this tool is designed primarily for use at OWP and with the goal of generating outputs for the NWS at a continental scale. If you are not that use case, you may need to tweak the inputs intelligently and remember to update config\params_template.env
to reflect the data you have available in your environment.
You can look for help with the -h flag:
/foss_fim/fim_pipeline.sh -h
Did that not make sense? That’s O.K! See below for more verbose instructions and relevent background.
https://github.com/NOAA-OWP/inundation-mapping
The process of creating the FIM library is a complex one. See this repo workflow broken down in visual form here (also note the beautiful graphic from the wiki; pilfered and pasted at the top of this page as well!).
See How I install and use docker for tips on setting up the environment
Grab input data.
```{bash}
# aws config
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/3dep_dems/10m_5070 . --exclude '*' --include 'HUC6_1209**_dem.tif' --request-payer requester --dryrun
aws s3 cp s3://noaa-nws-owp-fim/hand_fim/inputs/3dep_dems/10m_5070/fim_seamless_3dep_dem_10m_5070.vrt . --request-payer requester --dryrun
aws s3 cp s3://noaa-nws-owp-fim/hand_fim/inputs/3dep_dems/10m_5070/HUC6_dem_domain.gpkg . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/ahps_sites . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/bathymetery . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/huc_lists . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/landsea . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/nhdplus_vectors_aggregate . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/nld_vectors . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/nwm_hydrofabric . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/rating_curve . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/usgs_gages . --request-payer requester --dryrun
aws s3 cp --recursive s3://noaa-nws-owp-fim/hand_fim/inputs/wbd . --request-payer requester --dryrun
```
The pre_clip step shaves lots of time off the standard pattern of file > open.
Get an error? Maybe start docker?
```{sh}
> cd /mnt/OWP_FIM/inundation-mapping/
git clone https://github.com/NOAA-OWP/inundation-mapping.git
cd ./inundation-mapping/
docker build -f Dockerfile.dev -t owpfim:1.0 /mnt/OWP_FIM/inundation-mapping/inundation-mapping
```
See the changelog for why
.dev
is now included
The most relevant steering files are the /src/bash_variables.env
You enable HUCS with an inclusion in a list a la /data/inputs_huc_lists/testunit.lst
While there are “smart defaults” for many of the runtime arguments, this tool is designed primarily for use at OWP and with the goal of generating outputs for the NWS at a continental scale. If you are not that use case, you may need to tweak the inputs intelligently and remember to update config\params_template.env
to reflect the data you have available in your environment.
You can always look for help with the -h flag:
/foss_fim/fim_pipeline.sh -h
[[20220908105839]]
```{sh}
python3 /foss_fim/data/wbd/generate_pre_clip_fim_huc8.py -n /data/inputs/pre_clip_huc8/20240927 -u /data/inputs/huc_lists/testunit.lst
#python3 /foss_fim/data/aggregate_vector_inputs.py
python3 /foss_fim/src/preprocess_rasters.py -dem_dir /data/inputs/nhdplus_rasters/
```
```{sh}
python3 /foss_fim/data/acquire_and_preprocess_inputs.py -u 1209 <huc4s_to_process>
#python3 /foss_fim/data/aggregate_vector_inputs.py
python3 /foss_fim/src/preprocess_rasters.py -dem_dir /data/inputs/nhdplus_rasters/
```
python3 /foss_fim/data/acquire_and_preprocess_inputs.py -u 0804 python3 /foss_fim/data/preprocess_rasters.py -dem_dir /data/inputs/nhdplus_rasters/
https://github.com/NOAA-OWP/inundation-mapping/blob/dev/data/bridges/pull_osm_bridges.py#L321 https://github.com/NOAA-OWP/inundation-mapping/blob/dev/data/wbd/generate_pre_clip_fim_huc8.py#L136