bmorph¶
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.
Installation¶
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 setup.py 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¶
core
¶
The core
directory is where the functions for performing bias correction are located.
The bmorph.py
module contains the functions for individual bias corrections.
workflows.py
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.
util
¶
The util
directory contains the mizuroute_utils.py
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.
evaluation
¶
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.
Sitemap¶
- bmorph
- Bias Correction
- bmorph Tutorial: Getting your first bias corrections
- Expectations using this Tutorial
- Learning objectives & goals
- Import Packages and Load Data
- Test dataset: The Yakima River Basin
- Setting up some metadata
- Mapping the Yakima River Basin
- Loading in the streamflow data and associated meteorological data
- Spatially consistent bias correction
- Merging together the results
- Moving forward
- Data Overview
- Input Specifications
- Output Specifications
- Evaluation of Bias Correction
- Simple River Network (SRN)
- For Developers
- API Reference
- Core
- Utilities
- Evaluation
- Plotting
anomaly_scatter2D()
calc_water_year()
color_code_nxgraph()
compare_CDF()
compare_CDF_all()
compare_PDF()
compare_correction_scatter()
compare_mean_grouped_CPD()
correction_scatter()
create_adj_mat()
create_nxgraph()
custom_legend()
determine_row_col()
diff_maxflow_plotter()
diff_maxflow_sites()
draw_dataset()
find_all_upstream()
find_index_water_year()
find_upstream()
kl_divergence_annual_compare()
log10_1p()
norm_change_annual_flow()
organize_nxgraph()
pbias_compare_hist()
pbias_diff_hist()
pbias_plotter()
pbias_sites()
plot_reduced_flows()
plot_residual_overlay()
plot_spearman_rank_difference()
rmseFracPlot()
scatter_series_axes()
site_diff_scatter()
spearman_diff_boxplots_annual()
spearman_diff_boxplots_annual_compare()
stat_corrections_scatter2D()
- Simple River Network
SegNode
SimpleRiverNetwork
SimpleRiverNetwork.draw_network()
SimpleRiverNetwork.draw_multi_measure()
SimpleRiverNetwork.find_node()
SimpleRiverNetwork.find_like_pfaf()
SimpleRiverNetwork.collect_upstream_nodes()
SimpleRiverNetwork.generate_pfaf_map()
SimpleRiverNetwork.generate_weight_map()
SimpleRiverNetwork.generate_mainstream_map()
SimpleRiverNetwork.generate_pfaf_color_map()
SimpleRiverNetwork.generate_node_highlight_map()
SimpleRiverNetwork.pfaf_aggregate()
SimpleRiverNetwork.spawn_srn()
SimpleRiverNetwork.aggregate_measure()
SimpleRiverNetwork.aggregate_measure_max()
SimpleRiverNetwork.aggregate_measure_mean()
SimpleRiverNetwork.aggregate_measure_median()
SimpleRiverNetwork.aggregate_measure_min()
SimpleRiverNetwork.aggregate_measure_sum()
SimpleRiverNetwork.append_pfaf()
SimpleRiverNetwork.append_sequential()
SimpleRiverNetwork.check_upstream_end_marking()
SimpleRiverNetwork.clear_end_markers()
SimpleRiverNetwork.clear_network()
SimpleRiverNetwork.collect_upstream_nodes()
SimpleRiverNetwork.color_network_graph()
SimpleRiverNetwork.count_net_upstream()
SimpleRiverNetwork.draw_multi_measure()
SimpleRiverNetwork.draw_network()
SimpleRiverNetwork.encode_pfaf()
SimpleRiverNetwork.find_branch()
SimpleRiverNetwork.find_like_pfaf()
SimpleRiverNetwork.find_node()
SimpleRiverNetwork.find_tributary_basins()
SimpleRiverNetwork.force_upstream_area()
SimpleRiverNetwork.generate_mainstream_map()
SimpleRiverNetwork.generate_node_highlight_map()
SimpleRiverNetwork.generate_pfaf_codes()
SimpleRiverNetwork.generate_pfaf_color_map()
SimpleRiverNetwork.generate_pfaf_map()
SimpleRiverNetwork.generate_weight_map()
SimpleRiverNetwork.net_upstream_area()
SimpleRiverNetwork.parse_upstream()
SimpleRiverNetwork.pfaf_aggregate()
SimpleRiverNetwork.reconstruct_adj_mat()
SimpleRiverNetwork.size_network_graph()
SimpleRiverNetwork.sort_by_pfaf()
SimpleRiverNetwork.sort_streams()
SimpleRiverNetwork.spawn_srn()
SimpleRiverNetwork.update_node_area()
- Plotting