bmorph is a package for streamflow bias correction. bmorph is designed to work in conjunction with the mizuRoute streamflow routing model. bmorph provides methods for performing bias corrections that are spatially consistent as well as offers methods which can account for process-dependent biases. We discuss bmorph’s methodological details on the bias correction page. For an overview of the structure of bmorph, see the package overview, below.


We recommend installing bmorph using mamba using the command:

mamba create -n bmorph -c conda-forge bmorph

If you want to install from source, we provide an environment in environment.yml to manage the dependencies. You can build the environment by running:

mamba env create -f environment.yml

Then, to install bmorph run,

conda activate bmorph
python develop
python -m ipykernel install --user --name bmorph

Getting started

You can run through our interactive tutorial here. A static version of the tutorial can be found here.

bmorph Overview

Flowchart describing bmorph package directory structure to key directories util, core, and evaluation. util describes mizuroute_utils as "Configuring output from mizuRoute into input for bmorph. Blending and Conditioning pre-processing occurs here." core describes workflows as "Automated workflows for applying bmorph across multiple sites and time intervals" and bmorph as "Where bias correction computations take place for individual site and time increments." evaluation describes plotting as "Plotting functions for analyzing and visualizing bias corrections relative to reference and uncorrected data" and simple_river_network as "Pseudo-physical river network visualization for depicting spatial variables at stream segments across the watershed."


The core directory is where the functions for performing bias correction are located. The module contains the functions for individual bias corrections. contains the functions that define some helper workflows that make it easier to apply bias corrections across a stream network. More on the specifics of how bias correction is performed can be found in the Bias Correction page.


The util directory contains the module for organizing data exported by mizuRoute into an easily accessible form for bmorph. More on how data is handled can be found on the Data Overview page.


The evaluation directory provides tools for plotting and analyzing results. More on plotting functions and implemented statistics can be found on the Evaluation of Bias Correction page. More on the Simple River Network tool can be found on the Simple River Network (SRN) page.