get_matching_calstate

get_matching_calstate(context, calstate, predicate_fn)[source]

Return an IntervalCalState contain calibrations in the input IntervalCalState that match the predicate function.

The use case for this function is to identify calibrations matching a pattern so that those calibrations can be deleted or modified. For instance, matching registered bandpass caltables so they can be removed from the active CalState.

Parameters:
  • context (launcher.Context) -- Pipeline context (required to create IntervalCalState).

  • calstate (IntervalCalState) -- Calibration state to inspect.

  • predicate_fn (Callable[[CalToArgs, CalFrom], bool]) -- Matching function that returns True when the selection is to be added to the output IntervalCalState.

Returns:

IntervalCalState containing the calibrations from the input IntervalCalState that match the given predicate function.

Return type:

IntervalCalState