hydromodpy.calibration.metrics.network#

Physical network metrics for calibration prototypes.

The helpers in this module are intentionally solver-agnostic. They score a cell-based drainage network from positive per-cell outflow, cell centroids and cell areas. This keeps the first network/discharge calibration prototype out of the global calibration schema until the contract is stable.

Functions

active_network_mask(values, *[, threshold])

Return True where positive outflow exceeds threshold.

equivalent_network_length(mask, cell_area, ...)

Return the cell-network length equivalent sum(area) / d_tol.

nearest_distances_to_mask(centroids, mask)

Return distance from every centroid to the nearest active mask cell.

network_cost(d_sim, d_ref, centroids, ...[, ...])

Return the B0 physical network cost.

network_distance_error(d_sim, d_ref, ...[, ...])

Return the outflow-weighted placement error.

network_flux_error(d_sim, d_ref, *[, ...])

Return the normalized L1 error in per-cell drainage outflow.

network_length_error(mask_sim, mask_ref, ...)

Return the relative error in active network equivalent length.

positive_outflow(values)

Return a flat finite positive-outflow vector.

Classes

NetworkCost(total, components)

Composite network cost and diagnostic components.