Merge branch 'bernina-op' of https://github.com/paulscherrerinstitute/eco into bernina-op
This commit is contained in:
@@ -168,8 +168,7 @@ class DIAClient:
|
||||
sleep(time_interval)
|
||||
|
||||
def take_pedestal(
|
||||
self, n_frames=1000, analyze=True, analyze_locally=False, n_bad_modules=0
|
||||
):
|
||||
self, n_frames=1000, analyze=True, analyze_locally=False, n_bad_modules=0, freq=50):
|
||||
from jungfrau_utils.scripts.jungfrau_run_pedestals import (
|
||||
run as jungfrau_utils_run,
|
||||
)
|
||||
@@ -182,7 +181,7 @@ class DIAClient:
|
||||
os.makedirs(res_dir)
|
||||
os.chmod(res_dir, 0o775)
|
||||
filename = "pedestal_%s" % datetime.now().strftime("%Y%m%d_%H%M")
|
||||
period = 0.04
|
||||
period = 1/freq
|
||||
jungfrau_utils_run(
|
||||
self._api_address,
|
||||
filename,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import json
|
||||
import numpy as np
|
||||
from time import sleep
|
||||
from time import sleep,time
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
import colorama
|
||||
|
||||
|
||||
class Scan:
|
||||
@@ -65,9 +66,14 @@ class Scan:
|
||||
# for call in self.callbacks_start_step:
|
||||
# call()
|
||||
if self.checker:
|
||||
first_check = time()
|
||||
checker_unhappy = False
|
||||
while not self.checker.check_now():
|
||||
print("Condition checker is not happy, waiting for OK conditions.")
|
||||
print(colorama.Fore.RED+f"Condition checker is not happy, waiting for OK conditions since {time()-first_check:5.1f} seconds."+colorama.Fore.RESET,end="\r")
|
||||
sleep(self._checker_sleep_time)
|
||||
checker_unhappy = True
|
||||
if checker_unhappy:
|
||||
print(colorama.Fore.RED+f"Condition checker was not happy and waiting for {time()-first_check:5.1f} seconds."+colorama.Fore.RESET)
|
||||
self.checker.clear_and_start_counting()
|
||||
|
||||
if not len(self.values_todo) > 0:
|
||||
|
||||
@@ -101,6 +101,8 @@ class Laser_Exp:
|
||||
addMotorRecordToSelf(self, Id=self.Id + "-M521:MOTOR_1", name="delay_eos_stg")
|
||||
self.delay_eos = DelayTime(self.delay_eos_stg, name="delay_eos")
|
||||
self.alias.append(self.delay_eos.alias)
|
||||
self.lxt_eos = DelayTime(self.delay_eos_stg, direction=-1,name="lxt_eos")
|
||||
self.alias.append(self.lxt_eos.alias)
|
||||
# except Exception as expt:
|
||||
# print("Problems initializing eos delay stage")
|
||||
# print(expt)
|
||||
@@ -119,6 +121,8 @@ class Laser_Exp:
|
||||
)
|
||||
self.delay_glob = DelayTime(self.delay_glob_stg, name="delay_glob")
|
||||
self.alias.append(self.delay_glob.alias)
|
||||
self.lxt_glob = DelayTime(self.delay_glob_stg, direction=-1, name="lxt_glob")
|
||||
self.alias.append(self.lxt_glob.alias)
|
||||
except:
|
||||
print("Problems initializing global delay stage")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user