Skip to content

Commit

Permalink
DEV.BPM.FIX: Undo conflict handling problem introduced by vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
murilobalves committed Mar 13, 2023
1 parent 1a03ae5 commit 9da7941
Showing 1 changed file with 3 additions and 39 deletions.
42 changes: 3 additions & 39 deletions siriuspy/siriuspy/devices/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BPM(_Device):
'ACQTriggerDataThres-SP', 'ACQTriggerDataThres-RB',
'ACQTriggerDataPol-Sel', 'ACQTriggerDataPol-Sts',
'ACQTriggerDataHyst-SP', 'ACQTriggerDataHyst-RB',
'SwTagEn-Sel', 'SwTagEn-Sts', 'SwDivClk-RB',
'SwTagEn-Sel', 'SwTagEn-Sts', 'SwDivClk-RB',
'TbTTagEn-Sel', 'TbTTagEn-Sts',
'FAcqTagEn-Sel', 'FAcqTagEn-Sts',
'MonitTagEn-Sel', 'MonitTagEn-Sts',
Expand Down Expand Up @@ -859,44 +859,8 @@ def get_sampling_frequency(
return fadc / self.tbt_rate
elif acq_rate.lower().startswith('fofb'):
return fadc / self.fofb_rate
elif acq_rate.lower().startswith('monit1'):
return fadc / self.monit1_rate
return fadc / self.monit_rate

def get_switching_frequency(self, rf_freq: float) -> float:
"""Return the switching frequency.
Args:
rf_freq (float): RF frequency.
Returns:
float: switching frequency.
"""
fadc = rf_freq / self.harmonic_number * self.tbt_rate
return fadc / self.switching_rate

def get_sampling_frequency(
self, rf_freq: float, acq_rate='') -> float:
"""Return the sampling frequency of the acquisition.
Args:
rf_freq (float): RF frequency.
acq_rate (str, optional): acquisition rate. Defaults to ''.
If empty string, it gets the configured acq. rate on BPMs
Returns:
float: acquisition frequency.
"""
acq_rate = self.acq_channel_str if not acq_rate else acq_rate
fadc = rf_freq / self.harmonic_number * self.tbt_rate
if acq_rate.lower().startswith('tbt'):
return fadc / self.tbt_rate
elif acq_rate.lower().startswith('fofb'):
return fadc / self.fofb_rate
elif acq_rate.lower().startswith('monit1'):
return fadc / self.monit1_rate
elif acq_rate.lower().startswith('facq'):
return fadc / self.facq_rate
return fadc / self.monit_rate

def get_switching_frequency(self, rf_freq: float) -> float:
Expand Down

0 comments on commit 9da7941

Please sign in to comment.