diff --git a/build/lib/iexcode/instruments/Kappa.py b/build/lib/iexcode/instruments/Kappa.py index c64636c239688b6fa69e8863d1e9d55225e1ff95..f819d120bfac2c2cfac529fd1ae4067a722118d9 100644 --- a/build/lib/iexcode/instruments/Kappa.py +++ b/build/lib/iexcode/instruments/Kappa.py @@ -4,7 +4,7 @@ from math import floor from epics import caget, caput,PV -from iexcode.instruments.IEX_endstations import * +from iexcode.instruments.IEX_endstations import BL from iexcode.instruments.staff import staff_detector_dictionary from iexcode.instruments.files_and_folders import check_run,make_user_folders,folder_mda @@ -30,6 +30,9 @@ from iexcode.instruments.MPA import MPA from iexcode.instruments.spec_stuff import folders_spec +global Kappa_Motors +global tey, d3, d4, mesh, Kappa_scaler_pv, mpa +global tthdet ############################################################################# def Kappa_init(set_folders=False,reset=False,**kwargs): @@ -55,11 +58,9 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): Kappa_trigger_dictionary(),Kappa_scan_before_sequence(),Kappa_scan_after_sequence()) #endstation - global BL BL=Endstation('Kappa',kwargs['scan_ioc'],kwargs['xrays'],kwargs['BL_mode'],mda_scanRecord,Kappa_log_header,Kappa_log_entries) #global detectors - global tey, d3, d4, mesh, Kappa_scaler_pv, mpa tey = SRS("29idMZ0:scaler1.S2", '29idd:A1') d3 = SRS("29idMZ0:scaler1.S3", '29idd:A2') d4 = SRS("29idMZ0:scaler1.S4", '29idd:A3') @@ -68,8 +69,7 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): tth_pv = Kappa_motor_dictionary('tth')[3] mpa = MPA(tth_pv) - global tthdet - tthdet = Kappa_Detector() + tthdet = Kappa_Detector(Kappa_Motors) #setting folders if 'set_folders': @@ -84,7 +84,6 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): Kappa_reset() #motors - global Kappa_Motors physical_motors = ['x','y','z','tth','kth','kap','kphi'] psuedo_motors = ['th','chi','phi'] Kappa_Motors = Motors('Kappa',Kappa_motor_dictionary(),physical_motors,psuedo_motors) @@ -606,7 +605,7 @@ def Kappa_tth_reset_zero(): -def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detector=tey,**kwargs): +def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwargs): """ Scans th2th with variable gain on SRS# (srs_num). Gain is specified for a given th2th range by building tables as follow: @@ -630,6 +629,7 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detecto gu_table = np.append(gu_table, unit_dict('pA')) kwargs: + detector (default tey) scan_dim: 1 (default) cts: integration time for scalers and mpa/mcp => 0.1 (default) execute: True/False to start the scan => True (default) @@ -639,6 +639,11 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detecto kwargs.setdefault('cts',0.1) kwargs.setdefault('execute',True) + if 'detector' not in kwargs: + detector = tey + else: + detector = kwargs['detector'] + kth_offset = Kappa_kth_offset_get() motor_dictionary = Kappa_motor_dictionary() diff --git a/build/lib/iexcode/instruments/Kappa_det.py b/build/lib/iexcode/instruments/Kappa_det.py index c00102003a67795f719a521a8255f94ef567ca85..5c3e502e2c64d05d6b78c457c187c29a1eddc9e6 100644 --- a/build/lib/iexcode/instruments/Kappa_det.py +++ b/build/lib/iexcode/instruments/Kappa_det.py @@ -1,7 +1,6 @@ from time import sleep from epics import caget, caput -from iexcode.instruments.Kappa import Kappa_Motors ############################################################################################################## @@ -15,7 +14,7 @@ class Kappa_Detector: class for Kappa detector """ - def __init__(self): + def __init__(self,Kappa_Motors): self.get() def get(self): diff --git a/iexcode/instruments/Kappa.py b/iexcode/instruments/Kappa.py index c64636c239688b6fa69e8863d1e9d55225e1ff95..f819d120bfac2c2cfac529fd1ae4067a722118d9 100644 --- a/iexcode/instruments/Kappa.py +++ b/iexcode/instruments/Kappa.py @@ -4,7 +4,7 @@ from math import floor from epics import caget, caput,PV -from iexcode.instruments.IEX_endstations import * +from iexcode.instruments.IEX_endstations import BL from iexcode.instruments.staff import staff_detector_dictionary from iexcode.instruments.files_and_folders import check_run,make_user_folders,folder_mda @@ -30,6 +30,9 @@ from iexcode.instruments.MPA import MPA from iexcode.instruments.spec_stuff import folders_spec +global Kappa_Motors +global tey, d3, d4, mesh, Kappa_scaler_pv, mpa +global tthdet ############################################################################# def Kappa_init(set_folders=False,reset=False,**kwargs): @@ -55,11 +58,9 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): Kappa_trigger_dictionary(),Kappa_scan_before_sequence(),Kappa_scan_after_sequence()) #endstation - global BL BL=Endstation('Kappa',kwargs['scan_ioc'],kwargs['xrays'],kwargs['BL_mode'],mda_scanRecord,Kappa_log_header,Kappa_log_entries) #global detectors - global tey, d3, d4, mesh, Kappa_scaler_pv, mpa tey = SRS("29idMZ0:scaler1.S2", '29idd:A1') d3 = SRS("29idMZ0:scaler1.S3", '29idd:A2') d4 = SRS("29idMZ0:scaler1.S4", '29idd:A3') @@ -68,8 +69,7 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): tth_pv = Kappa_motor_dictionary('tth')[3] mpa = MPA(tth_pv) - global tthdet - tthdet = Kappa_Detector() + tthdet = Kappa_Detector(Kappa_Motors) #setting folders if 'set_folders': @@ -84,7 +84,6 @@ def Kappa_init(set_folders=False,reset=False,**kwargs): Kappa_reset() #motors - global Kappa_Motors physical_motors = ['x','y','z','tth','kth','kap','kphi'] psuedo_motors = ['th','chi','phi'] Kappa_Motors = Motors('Kappa',Kappa_motor_dictionary(),physical_motors,psuedo_motors) @@ -606,7 +605,7 @@ def Kappa_tth_reset_zero(): -def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detector=tey,**kwargs): +def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,**kwargs): """ Scans th2th with variable gain on SRS# (srs_num). Gain is specified for a given th2th range by building tables as follow: @@ -630,6 +629,7 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detecto gu_table = np.append(gu_table, unit_dict('pA')) kwargs: + detector (default tey) scan_dim: 1 (default) cts: integration time for scalers and mpa/mcp => 0.1 (default) execute: True/False to start the scan => True (default) @@ -639,6 +639,11 @@ def Kappa_th2th_scan_sensitivity(th_table,gain_num_table,gain_unit_table,detecto kwargs.setdefault('cts',0.1) kwargs.setdefault('execute',True) + if 'detector' not in kwargs: + detector = tey + else: + detector = kwargs['detector'] + kth_offset = Kappa_kth_offset_get() motor_dictionary = Kappa_motor_dictionary() diff --git a/iexcode/instruments/Kappa_det.py b/iexcode/instruments/Kappa_det.py index c00102003a67795f719a521a8255f94ef567ca85..5c3e502e2c64d05d6b78c457c187c29a1eddc9e6 100644 --- a/iexcode/instruments/Kappa_det.py +++ b/iexcode/instruments/Kappa_det.py @@ -1,7 +1,6 @@ from time import sleep from epics import caget, caput -from iexcode.instruments.Kappa import Kappa_Motors ############################################################################################################## @@ -15,7 +14,7 @@ class Kappa_Detector: class for Kappa detector """ - def __init__(self): + def __init__(self,Kappa_Motors): self.get() def get(self): diff --git a/iexcode/instruments/__pycache__/Kappa.cpython-37.pyc b/iexcode/instruments/__pycache__/Kappa.cpython-37.pyc index 736a0ae36869c21290ea6c99ada18730aef76083..6a49022d4993b64ef4ab43a6b7172ca1fad232be 100644 Binary files a/iexcode/instruments/__pycache__/Kappa.cpython-37.pyc and b/iexcode/instruments/__pycache__/Kappa.cpython-37.pyc differ diff --git a/iexcode/instruments/__pycache__/Kappa_det.cpython-37.pyc b/iexcode/instruments/__pycache__/Kappa_det.cpython-37.pyc index b79f19388690f3f26c6f29f4833f23d50c264c21..8abdb62bdff80a559d717666b3bb53156017a41d 100644 Binary files a/iexcode/instruments/__pycache__/Kappa_det.cpython-37.pyc and b/iexcode/instruments/__pycache__/Kappa_det.cpython-37.pyc differ