imap_processing.hi.utils.get_tof_window_mask#

imap_processing.hi.utils.get_tof_window_mask(de_ds: Dataset, tof_windows: dict[str, tuple[float, float]], tof_fill_vals: dict[str, float]) ndarray[tuple[int, ...], dtype[bool]]#

Generate mask indicating which DEs pass TOF window checks.

An event passes the TOF window check for a given detector pair if its TOF value is within the (low, high) bounds OR equals the fill value (indicating the detector pair was not hit).

Parameters:
  • de_ds (xarray.Dataset) – Direct Event Dataset with TOF variables (tof_ab, tof_ac1, tof_bc1, tof_c1c2).

  • tof_windows (dict[str, tuple[float, float]]) – Dictionary mapping TOF field names to (low, high) tuples defining the acceptable window for each TOF measurement.

  • tof_fill_vals (dict[str, float]) – Fill values for each TOF field - events with fill values pass the check. If not provided, fill value handling is disabled.

Returns:

mask – Boolean mask where True = event passes all specified TOF window checks.

Return type:

numpy.ndarray