fixed some stuff in dia, which was apparently cleaned from some older version.
This commit is contained in:
+16
-16
@@ -35,23 +35,23 @@ class CheckerCA:
|
||||
return fraction >= self.required_fraction
|
||||
|
||||
|
||||
checker_obj = Checker_obj(checkerPV)
|
||||
# checker_obj = Checker_obj(checkerPV)
|
||||
|
||||
|
||||
checker_ready = {}
|
||||
checker_ready["checker_call"] = checker_function
|
||||
checker_ready["args"] = [[60, 700]]
|
||||
checker_ready["kwargs"] = {}
|
||||
checker_ready["wait_time"] = 3
|
||||
# checker_ready = {}
|
||||
# checker_ready["checker_call"] = checker_function
|
||||
# checker_ready["args"] = [[60, 700]]
|
||||
# checker_ready["kwargs"] = {}
|
||||
# checker_ready["wait_time"] = 3
|
||||
|
||||
checker_init = {}
|
||||
checker_init["checker_call"] = checker_obj.clear_and_start_counting
|
||||
checker_init["args"] = []
|
||||
checker_init["kwargs"] = {}
|
||||
checker_init["wait_time"] = None
|
||||
# checker_init = {}
|
||||
# checker_init["checker_call"] = checker_obj.clear_and_start_counting
|
||||
# checker_init["args"] = []
|
||||
# checker_init["kwargs"] = {}
|
||||
# checker_init["wait_time"] = None
|
||||
|
||||
checker_end = {}
|
||||
checker_end["checker_call"] = checker_obj.stop_and_analyze
|
||||
checker_end["args"] = [[60, 700], .7]
|
||||
checker_end["kwargs"] = {}
|
||||
checker_end["wait_time"] = None
|
||||
# checker_end = {}
|
||||
# checker_end["checker_call"] = checker_obj.stop_and_analyze
|
||||
# checker_end["args"] = [[60, 700], .7]
|
||||
# checker_end["kwargs"] = {}
|
||||
# checker_end["wait_time"] = None
|
||||
|
||||
@@ -42,6 +42,7 @@ class DIAClient:
|
||||
if instrument is None:
|
||||
print("ERROR: please configure the instrument parameter in DIAClient")
|
||||
self.update_config()
|
||||
self.active_clients = list(self.get_active_clients()['clients_enabled'].keys())
|
||||
|
||||
def update_config(self,):
|
||||
self.writer_config.update({
|
||||
@@ -204,6 +205,9 @@ class DIAClient:
|
||||
def wait_for_status(self, *args, **kwargs):
|
||||
return self.client.wait_for_status(*args, **kwargs)
|
||||
|
||||
def get_active_clients(self):
|
||||
return self.client.get_clients_enabled()
|
||||
|
||||
def acquire(self, file_name=None, Npulses=100, JF_factor=1, bsread_padding=0):
|
||||
"""
|
||||
JF_factor?
|
||||
@@ -261,11 +265,12 @@ class DIAClient:
|
||||
if stat["status"] == "IntegrationStatus.DETECTOR_STOPPED":
|
||||
done = True
|
||||
sleep(0.1)
|
||||
outputfilenames = [f'{file_name_JF}.{tcli.upper()}.h5' for tcli in self.active_clients]
|
||||
|
||||
return Acquisition(
|
||||
acquire=acquire,
|
||||
acquisition_kwargs={
|
||||
"file_names": [file_name_bsread, file_name_JF],
|
||||
"file_names": outputfilenames,
|
||||
"Npulses": Npulses,
|
||||
},
|
||||
hold=False,
|
||||
|
||||
@@ -44,7 +44,6 @@ class Scan:
|
||||
"scan_step_info": [],
|
||||
}
|
||||
self.scan_info_filename = os.path.join(self.scan_info_dir, fina)
|
||||
self.scan_info_filename += "_scan_info.json"
|
||||
self._scan_directories = scan_directories
|
||||
self.checker = checker
|
||||
self.initial_values = []
|
||||
@@ -54,15 +53,15 @@ class Scan:
|
||||
print("Initial value of %s : %g" % (adj.name, tv))
|
||||
|
||||
def get_filename(self, stepNo, Ndigits=4):
|
||||
fina = os.path.join(self.basepath, self.fina)
|
||||
fina = os.path.join(self.basepath, Path(self.fina).stem)
|
||||
if self._scan_directories:
|
||||
fina = os.path.join(fina, self.fina)
|
||||
fina += "_step%04d" % stepNo
|
||||
return fina
|
||||
|
||||
def doNextStep(self, step_info=None, verbose=True):
|
||||
for call in self.callbacks_start_step:
|
||||
call()
|
||||
# for call in self.callbacks_start_step:
|
||||
# call()
|
||||
if self.checker:
|
||||
while not self.checker["checker_call"](
|
||||
*self.checker["args"], **self.checker["kwargs"]
|
||||
@@ -280,7 +279,7 @@ class RunFilenameGenerator:
|
||||
self.prefix + self.Ndigits * "[0-9]" + self.separator + "*." + self.suffix
|
||||
)
|
||||
fl = [tf for tf in fl if tf.is_file()]
|
||||
runnos = [int(tf.split(self.prefix)[1].split(self.separator)[0]) for tf in fl]
|
||||
runnos = [int(tf.name.split(self.prefix)[1].split(self.separator)[0]) for tf in fl]
|
||||
return runnos
|
||||
|
||||
def get_nextrun_filename(self, name):
|
||||
|
||||
Reference in New Issue
Block a user