accelmo.tracking.ranges

The BPM ranges a tracking fit tracks between.

accelmo.tracking.ranges.filter_bad_bpms(bpm_start_points, bpm_end_points, bad_bpms)[source]

Remove bad BPMs from start and end point lists.

Parameters:
  • bpm_start_points (list[str]) – List of starting BPM names

  • bpm_end_points (list[str]) – List of ending BPM names

  • bad_bpms (list[str] | None) – Optional list of BPM names to remove

Return type:

tuple[list[str], list[str]]

Returns:

Tuple of (filtered_start_points, filtered_end_points)

Parameters:
  • bpm_start_points (list[str])

  • bpm_end_points (list[str])

  • bad_bpms (list[str] | None)

class accelmo.tracking.ranges.BpmRanges(plan, start_bpms, end_bpms, all_bpms, use_fixed_bpm, fixed_start='', fixed_end='')[source]

Bases: object

The start and end points of a tracking fit, restricted to the observed range.

fixed_start/fixed_end are the fixed BPM window taken from the magnet range when use_fixed_bpm is set and the plan uses one; empty otherwise.

Parameters:
  • plan (TrackingPlan)

  • start_bpms (list[str])

  • end_bpms (list[str])

  • all_bpms (list[str])

  • use_fixed_bpm (bool)

  • fixed_start (str)

  • fixed_end (str)

plan: TrackingPlan
start_bpms: list[str]
end_bpms: list[str]
all_bpms: list[str]
use_fixed_bpm: bool
fixed_start: str = ''
fixed_end: str = ''
accelmo.tracking.ranges.resolve_bpm_ranges(machine, plan, bpm_start_points, bpm_end_points, use_fixed_bpm)[source]

Drop bad BPMs and those outside the observed range, and set the fixed BPM window.

Return type:

BpmRanges

Parameters:
  • machine (MachineSetup)

  • plan (TrackingPlan)

  • bpm_start_points (list[str])

  • bpm_end_points (list[str])

  • use_fixed_bpm (bool)