diff --git a/CHAP/utils/scanparsers.py b/CHAP/utils/scanparsers.py index 1d7b343..bd97460 100755 --- a/CHAP/utils/scanparsers.py +++ b/CHAP/utils/scanparsers.py @@ -555,7 +555,7 @@ def get_spec_scan_motor_mnes(self): m2_mne_i = 5 m2_mne = self.spec_args[m2_mne_i] return (m1_mne, m2_mne) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): return (self.spec_args[0],) if self.spec_macro in ('tseries', 'loopscan'): return ('Time',) @@ -584,11 +584,19 @@ def get_spec_scan_motor_vals(self): m2_npt = int(self.spec_args[m2_nint_i]) + 1 fast_mot_vals = np.linspace(m1_start, m1_end, m1_npt) slow_mot_vals = np.linspace(m2_start, m2_end, m2_npt) + if self.spec_macro in ('flydmesh', 'dmesh'): + fast_mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[0]) + slow_mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[1]) return (fast_mot_vals, slow_mot_vals) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): mot_vals = np.linspace(float(self.spec_args[1]), float(self.spec_args[2]), int(self.spec_args[3])+1) + if self.spec_macro == 'flydscan': + mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[0]) return (mot_vals,) if self.spec_macro in ('tseries', 'loopscan'): return self.spec_scan.data[:,0] @@ -608,7 +616,7 @@ def get_spec_scan_shape(self): m2_nint_i = 8 slow_mot_npts = int(self.spec_args[m2_nint_i]) + 1 return (fast_mot_npts, slow_mot_npts) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): mot_npts = int(self.spec_args[3])+1 return (mot_npts,) if self.spec_macro in ('tseries', 'loopscan'): @@ -625,7 +633,7 @@ def get_spec_scan_dwell(self): # Accommodate pre-summer-2022 format dwell = float(self.spec_args[8]) return dwell - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): return float(self.spec_args[4]) if self.spec_macro in ('tseries', 'loopscan'): return float(self.spec_args[1]) @@ -716,7 +724,7 @@ class SMBLinearScanParser(LinearScanParser, SMBScanParser): """ def get_spec_scan_dwell(self): - if self.spec_macro in ('flymesh', 'mesh'): + if self.spec_macro in ('flymesh', 'mesh', 'flydmesh'): try: # Try post-summer-2022 format dwell = float(self.spec_args[4]) @@ -724,7 +732,7 @@ def get_spec_scan_dwell(self): # Accommodate pre-summer-2022 format dwell = float(self.spec_args[8]) return dwell - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): return float(self.spec_args[4]) if self.spec_macro == 'tseries': return float(self.spec_args[1]) @@ -734,7 +742,7 @@ def get_spec_scan_dwell(self): f'for scans of type {self.spec_macro}') def get_spec_scan_motor_mnes(self): - if self.spec_macro in ('flymesh', 'mesh'): + if self.spec_macro in ('flymesh', 'mesh', 'flydmesh'): m1_mne = self.spec_args[0] try: # Try post-summer-2022 format @@ -746,7 +754,7 @@ def get_spec_scan_motor_mnes(self): m2_mne_i = 5 m2_mne = self.spec_args[m2_mne_i] return (m1_mne, m2_mne) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): return (self.spec_args[0],) if self.spec_macro in ('tseries', 'loopscan'): return ('Time',) @@ -754,7 +762,7 @@ def get_spec_scan_motor_mnes(self): f'for scans of type {self.spec_macro}') def get_spec_scan_motor_vals(self): - if self.spec_macro in ('flymesh', 'mesh'): + if self.spec_macro in ('flymesh', 'mesh', 'flydmesh'): m1_start = float(self.spec_args[1]) m1_end = float(self.spec_args[2]) m1_npt = int(self.spec_args[3]) + 1 @@ -775,11 +783,19 @@ def get_spec_scan_motor_vals(self): m2_npt = int(self.spec_args[m2_nint_i]) + 1 fast_mot_vals = np.linspace(m1_start, m1_end, m1_npt) slow_mot_vals = np.linspace(m2_start, m2_end, m2_npt) + if self.spec_macro == 'flydmesh': + fast_mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[0]) + slow_mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[1]) return (fast_mot_vals, slow_mot_vals) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): mot_vals = np.linspace(float(self.spec_args[1]), float(self.spec_args[2]), int(self.spec_args[3])+1) + if self.spec_macro == 'flydscan': + mot_vals += self.get_positioner_value( + self.spec_scan_motor_mnes[0]) return (mot_vals,) if self.spec_macro in ('tseries', 'loopscan'): return (self.spec_scan.data[:,0],) @@ -787,7 +803,7 @@ def get_spec_scan_motor_vals(self): f'for scans of type {self.spec_macro}') def get_spec_scan_shape(self): - if self.spec_macro in ('flymesh', 'mesh'): + if self.spec_macro in ('flymesh', 'mesh', 'flydmesh'): fast_mot_npts = int(self.spec_args[3]) + 1 try: # Try post-summer-2022 format @@ -799,7 +815,7 @@ def get_spec_scan_shape(self): m2_nint_i = 8 slow_mot_npts = int(self.spec_args[m2_nint_i]) + 1 return (fast_mot_npts, slow_mot_npts) - if self.spec_macro in ('flyscan', 'ascan'): + if self.spec_macro in ('flyscan', 'ascan', 'flydscan'): mot_npts = int(self.spec_args[3])+1 return (mot_npts,) if self.spec_macro in ('tseries', 'loopscan'):