Skip to content

Commit 6fe0828

Browse files
committed
specify rms in fake alignment of bpms
1 parent 361c9a4 commit 6fe0828

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pySC/tuning/tuning_core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,17 @@ def bba_to_quad_true_offset(self, bpm_name: str, plane=None) -> Union[float, tup
242242
else:
243243
raise Exception(f'Unknown {plane=}')
244244

245-
def fake_align_bpms(self, bpm_names: Optional[list[str]] = None):
245+
def fake_align_bpms(self, bpm_names: Optional[list[str]] = None, rms_offset: float = 0.):
246246
SC = self._parent
247247
if bpm_names is None:
248248
bpm_names = SC.bpm_system.names
249249

250250
for bpm_name in bpm_names:
251251
bpm_number = SC.bpm_system.bpm_number(name=bpm_name)
252252
bba_x, bba_y = self.bba_to_quad_true_offset(bpm_name=bpm_name)
253+
if rms_offset > 0:
254+
bba_x += SC.rng.normal_trunc(loc=0, scale=rms_offset)
255+
bba_y += SC.rng.normal_trunc(loc=0, scale=rms_offset)
253256
self._parent.bpm_system.bba_offsets_x[bpm_number] = bba_x
254257
self._parent.bpm_system.bba_offsets_y[bpm_number] = bba_y
255258

0 commit comments

Comments
 (0)