pcdsdaq.ami.dets_filter

pcdsdaq.ami.dets_filter(*args, event_codes=None, operator='&', or_bykik=True)

Return valid l3t/pyami filter strings in a useful format.

The function takes in arbitrary dets whose prefixes are the ami names, along with low and highs. Event codes are handled as a special case, since you always want high vs low.

Note

By default this will treat bykik at an l3t pass! This is so you don’t lose your off shots when the l3t trigger is in veto mode. You can disable this with or_bykik=False, but this will remain the default behavior for backwards compatibility and to prevent someone from losing shots that they wanted in the data.

Parameters:
  • *args ((AmiDet, float, float) n times) – A sequence of (detector, low, high), which create filters that make sure the detector is between low and high. You can omit the first AmiDet as a shorthand for the current monitor, assuming a monitor has been set with Daq.set_monitor or set_monitor_det.

  • event_codes (list, optional) – A list of event codes to include in the filter. l3pass will be when the event code is present.

  • operator (str, optional) – The operator for combining the detector ranges and event codes. This can either be | to or the conditions together, so l3pass will happen if any filter passes, or it can be left at the default & to and the conditions together, so l3pass will only happen if all filters pass.

  • or_bykik (bool, optional) – True by default, appends an or condition that marks l3t pass when we see the bykik event code. This makes sure the off shots make it into the data if we’re in l3t veto mode.

Returns:

filter_string – A valid filter string for AmiDet or for pyami.set_l3t

Return type:

str