Commit de353bc4 authored by Yoann Sallaz Damaz's avatar Yoann Sallaz Damaz
Browse files

add coder gamma2, khi2, versapin

parent 965cce8a
Pipeline #59656 failed with stages
......@@ -607,7 +607,7 @@ class grob_FIP(object):
self.wago.set("magnet_degauss",0)
if self.CryoShort == 1:
if not(kappaactiondone):
self.heatgun.on(60)
self.heatgun.on(70)
self.kappa.reset_pos()
kappaactiondone=True
if self.kappa.position<10:
......@@ -656,11 +656,21 @@ class grob_FIP(object):
def wash(self):
self.send_command("wash")
def anneal(self):
self.send_command("anneal")
def anneal(self, nb_move = 3, nb_sec_in = 1, nb_sec_out = 0.5):
self.send_command("anneal", [nb_move,int(nb_sec_in*100+32767),int(nb_sec_out*100+32767)])
def mount_versa_pin(self):
self.send_command("mount_versa_pin")
def mount_dismount_versa_pin(self):
#self.bstop1.down()
#self.dstop.down()
#if self.bstop1.is_up() or self.dstop.is_up():
# print("Beam stop or Dstop is up -> Aborting")
# return
self.force_gripper(3)
time.sleep(1)
if self.get_state() in [SampleChangerState.Ready, SampleChangerState.Loaded]:
self.send_command("mount_versa_pin")
def move_rel(self, x, y, z):
self.send_command("move_rel", [float_to_word(x), float_to_word(y), float_to_word(z)])
......
......@@ -46,9 +46,10 @@ def change_energy(value):
def find_energy_in_conf(nrj_target, force=False):
cc = get_config()
cc.reload()
optical_conf = cc.get("optical_setup")
list_selected_str = list(optical_conf["selected"].keys())
date_selected =list(optical_conf["selected"].values())
optical_conf = cc.get("optical_setup")
optical_conf_selected = dict(filter(lambda entry: entry[1]!= 'interpolate', optical_conf["selected"].items()))
list_selected_str = list(optical_conf_selected.keys())
date_selected =list(optical_conf_selected.values())
list_selected_dict = {float(i):i for i in list_selected_str}
list_selected_float = list(list_selected_dict.keys())
list_selected_float.sort()
......@@ -111,7 +112,9 @@ def find_energy_in_conf(nrj_target, force=False):
def beam_set(nrj_target, mono_only=False, force=False):
final_pos_dict = find_energy_in_conf(nrj_target, force=force)
final_pos_dict_with_enc = find_energy_in_conf(nrj_target, force=force)
final_pos_dict = dict(filter(lambda entry: "_enc" not in entry[0], final_pos_dict_with_enc.items()))
if final_pos_dict is None:
return
......@@ -184,7 +187,7 @@ def beam_set(nrj_target, mono_only=False, force=False):
progressbar[motor]["bar"].count=(100.*(motor.position-progressbar[motor]["init"])/(progressbar[motor]["final"]-progressbar[motor]["init"]))
else:
distance = abs(motor.position-final_pos_dict.get(motor.name))
if distance>0.1:
if distance>motor.tolerance:
ok = False
motorfail=motor
else:
......@@ -212,6 +215,14 @@ def beam_set(nrj_target, mono_only=False, force=False):
for motor in motor_list:
motor.apply_config(reload=True)
if "gamma2_enc" in final_pos_dict_with_enc.keys():
for repeat in range(0,4):
mvr(gamma2, float(final_pos_dict_with_enc['gamma2_enc'])-gamma2_enc.read())
if "khi2_enc" in final_pos_dict_with_enc.keys():
for repeat in range(0,4):
mvr(khi2, float(final_pos_dict_with_enc['khi2_enc'])-khi2_enc.read())
def mono_stop():
utx.stop()
......@@ -275,7 +286,7 @@ def beam_save():
#tab_nrj_choice = [(str(i[3]), "%s(%s) %.2fkeV"%(i[0],i[1],i[2])) for i in tab_nrj]
tab_nrj_choice = [(str(i), "%6s %6s"%(str(i),"-".join(tab_nrj[np.argwhere(tab_nrj_kev==i)[0][0]][0:2]))) for i in list_nrj_setup]
dlg3 = UserChoice(label="Your are currently at %.2fkeV - Choose the energy for saving the current motors positions"%(motenergy.position/1000.), values=tab_nrj_choice, defval=idx)
dlg3 = UserChoice(label="Your are currently at %.2fkeV - Choose the energy for saving the current motors positions"%(motenergy.position), values=tab_nrj_choice, defval=idx)
new_nrg_to_save = BlissDialog( [ [ dlg3 ] ], title='Beam save').show()
if new_nrg_to_save is not False:
new_nrg_to_save = list(new_nrg_to_save.values())[0]
......@@ -295,7 +306,9 @@ def beam_save():
"actam2":actam2.position,
"actav2":actav2.position,
"c2bendbk":c2bendbk.position,
"c2bendfr":c2bendfr.position
"c2bendfr":c2bendfr.position,
"khi2_enc":khi2_enc.read(),
"gamma2_enc":gamma2_enc.read()
}
today_str = datetime.datetime.today().strftime('%Y-%m-%d_%H-%M')
......@@ -601,10 +614,12 @@ def saveMonitorsImage(cam,string): #cam in binary string 0000 to 1111, each char
def film_FIP(temps_en_deux_image_sec, duree_total_enregis_sec):
for i in range(0,int(duree_total_enregis_sec/temps_en_deux_image_sec)):
safshut.open()
frontend.open()
fluo3.open()
sleep(2)
saveMonitorsImage("0001","")
sleep(2)
safshut.close()
frontend.close()
sleep(temps_en_deux_image_sec)
def scanMovehM1Sl0(relMin, relMax, step, pics=False, sourceAngle_uRad=0):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment