pywrdrb.post.metrics.get_shortfall_metrics#
- pywrdrb.post.metrics.get_shortfall_metrics(major_flows, lower_basin_mrf_contributions, mrf_targets, ibt_demands, ibt_diversions, models_mrf, models_ibt, nodes, shortfall_threshold=0.95, shortfall_break_length=7, units='MG', start_date=None, end_date=None)#
Compute shortfall metrics including reliability, resiliency, and event statistics.
Metrics are computed per model realization for each node in the list. These include the probability of meeting flow/demand thresholds, and severity, duration, and vulnerability of shortfall events.
- Parameters:
major_flows (dict) – Simulated flow time series for each model and realization.
lower_basin_mrf_contributions (dict) – Extra-release contributions from lower basin reservoirs.
mrf_targets (dict) – MRF target flows by model and realization.
ibt_demands (dict) – Inter-basin transfer demands (e.g., NY, NJ).
ibt_diversions (dict) – Actual inter-basin transfers simulated.
models_mrf (list of str) – Models associated with flow MRF metrics.
models_ibt (list of str) – Models associated with inter-basin transfer metrics.
nodes (list of str) – Nodes of interest for evaluating performance.
shortfall_threshold (float, optional) – Minimum fraction of target to consider “satisfied”. Default is 0.95.
shortfall_break_length (int, optional) – Number of non-shortfall days needed to end a shortfall event. Default is 7.
units (str, optional) – Units of flow (‘MG’ or ‘MCM’). Default is ‘MG’.
start_date (str or pd.Timestamp, optional) – Start date for subset.
end_date (str or pd.Timestamp, optional) – End date for subset.
- Returns:
resultsdict – Nested dictionary of performance metrics for each node, model, and realization.
- Return type:
dict
Notes
Key outputs include time-series and event-based metrics for drought vulnerability assessments.