flows2fim
is a command line utility program that creates composite FIMs for different flow conditions utilizing input FIM libraries and rating curves database.
It has the following commands.
controls
: Given a flow file and a rating curves database, create a control table of reach flows and downstream boundary conditions.fim
: Given a control table and a fim library folder. Create a flood inundation map for the control conditions.- validate: Given a FIM library folder and a rating curves database, validate there is one-to-one correspondence between the entries of the rating curves table and FIM library objects.
Dependencies:
- 'fim' and 'validate' commands need access to GDAL. GDAL must be installed separately and made available in Path.
Units:
Current support is for English units. The flow values must be in cfs
-
Download
flows2fim
executables froms3://fimc-data/flows2fim/release-assets/v0.2.0/
. -
Install
GDAL
if you don't already have it.GDAL can be installed through a variety of ways.
- On Windows: The easiest way is through
OSGeo4W
installer https://trac.osgeo.org/osgeo4w/#QuickStartforOSGeo4WUsers - On Ubuntu Linux: Run
apt-get update && apt-get install -y gdal-bin
- On Windows: The easiest way is through
-
Make sure
flows2fim
andGDAL
both are available in your Path.- On Windows: The easiest way is to place the downloaded
flows2fim.exe
file from step 1 inC:\OSGeo4W\bin
and then useOSGeo4W Shell
for the next steps - On Linux: Simplest option is to place the downloaded
flows2fim
file in/bin
folder
- On Windows: The easiest way is to place the downloaded
-
Get familiar using
flows2fim -h
andflows2fim COMMAND -h
. -
Download Baxter sample data from
s3://fimc-data/flows2fim/sample_data/v0_2_0/Baxter
if you don't have a dataset already. -
To create control file from 100yr flows file run
flows2fim controls -db "Baxter/ripple.gpkg" -f "Baxter/flows/flows_100yr_cfs.csv" -o "Baxter/controls_100yr.csv" -sids 2821866
-
To create Depth VRT run
flows2fim fim -lib "Baxter/library" -c "Baxter/controls_100yr.csv" -o "Baxter/fim_100yr.vrt"
-
Clone the repository and perform following steps from the root of the repo.
-
Download Baxter testdata from
s3://fimc-data/flows2fim/sample_data/v0_2_0/Baxter
totestdata/Baxter
folder. -
Launch a docker container using
docker compose up
and run following commands inside the container -
Run
go run main.go controls -db "testdata/Baxter/ripple.gpkg" -f "testdata/Baxter/flows/flows_100yr_cfs.csv" -o "testdata/Baxter/controls_100yr.csv" -sids 2821866
This will create a controls.csv file -
Run
go run main.go fim -lib "testdata/Baxter/library" -c "testdata/Baxter/controls_100yr.csv" -o "testdata/Baxter/fim_100yr.vrt"
This will create a VRT file. VRT can be tested by loading in QGIS.
-
cmd
: Contains individual folders for different commands. -
pkg
: Houses reusable packages potentially useful in other projects. -
internal
: For private application code not intended for external use. -
scripts
: Includes useful scripts for building, testing, and more.
- Run
go test ./...
to run automated tests.
Run ./scripts/build-linux-amd64.sh
This will place the executable in builds/linux-amd64
.