nwm_metrics.event_metric_functions.pair_events#

nwm_metrics.event_metric_functions.pair_events(events_obs, events_mod, threshold, virtual_strategy='obs')[source]#

One-to-one pairing of observed and model events with optional virtual events.

For unmatched observed events, can optionally create virtual model events with same start/end as observed to avoid penalizing model events below threshold. Similarly for unmatched model events. The virtual_strategy parameter controls which virtual events to create.

Return type:

DataFrame

Parameters:
  • events_obs – pd.DataFrame Observed events with columns: start, end, peak_value

  • events_mod – pd.DataFrame Model events with columns: start, end, peak_value

  • threshold – float Only events with peak_value >= threshold are paired.

  • virtual_strategy – str Controls handling of unmatched events: - “none”: no virtual events - “obs”: virtual model window for unmatched observed events - “mod”: virtual observed window for unmatched model events - “both”: apply both

Returns:

obs_start, obs_end, mod_start, mod_end, status

Return type:

pd.DataFrame with columns