Welcome to swiflow

WARNING: Swiflow is under active development on its master branch.

https://img.shields.io/pypi/v/swiflow.svg Documentation Status https://travis-ci.org/USDA-ARS-NWRC/swiflow.svg?branch=master

A python package for modeling streamflow using surface water input from iSnobal

Usage

Once installed, swiflow is ran as simply as:

swiflow config.ini

Setting up a new project

To setup a project you must have a vector for each subbasin representing water landing on the ground surface. In most cases this project uses aggregated Surface Water Input (SWI) from iSnobal typically generated using AWSM .

  1. To setup a basin consider using delineate with the –streamflow flag. THis will create all the static files you need for your basin.

  2. SWI is usually outputted as an image. To aggregate SWI to a vector, SWIFlow has a function to manage this which is used like the code below. This will produce a CSV containing the vectorized surface water input (SWI) by looping through the watersheds and the em.nc file.

    prep_swi em.nc watersheds.shp SWI
    
  3. Setup a config.ini that looks similar to the one in ./examples/catchment_csv/config.ini which should point to the new files you just created. For more info on the config simply use inicheck:

    inicheck -m swiflow --details <section>
    
  4. Once you have started a configuration file, attempt to determine the max_infiltration setting in your config file by running the following command over a whole water year. To do this you will also need provide a path to observed_streamflow in the config file.

    solve_rmax config.ini
    

    This will print out the estimated max_infiltration.

  5. Once a max_infiltration value is determined. Use the calibrate_swi tool to estimate the upper_residence_time and lower_residence_time by running the following command over a whole water year and setting your timestep to 4 hours to speed it up:

    calibrate_swi config.ini
    

    The calibration process is still experimental so you may need to adjust values still. Attempt to use a value set that was listed in the print out from the calibration scheme will help narrow it down.

  6. Once you have your parameters set, set the dates of interest and run:

    swiflow config.ini
    

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.