commented disable_ebeam_coupling; shortened wait times; added more Energy to distance factors

This commit is contained in:
2022-07-06 18:10:03 +02:00
parent d6505636fb
commit 2eaaa5c61f

View File

@@ -119,11 +119,12 @@ class UndulatorCoupledDoubleCrystalMonoEnergy(Adjustable):
return self._as_task(changer, hold=hold, stopper=self.stop) return self._as_task(changer, hold=hold, stopper=self.stop)
def move_and_wait(self, value, wait_time=0.1): def move_and_wait(self, value, wait_time=0.1):
self.disable_ebeam_coupling() # self.disable_ebeam_coupling()
self.pvs.setvalue.put(value) self.pvs.setvalue.put(value)
self.und.set_target_value(value) self.und.set_target_value(value)
sleep(3) #TODO: is this correct? sleep(1) #TODO: is this correct?
while self.is_moving(): while self.is_moving():
print("mono is moving")
sleep(wait_time) sleep(wait_time)
def is_moving(self): def is_moving(self):
@@ -133,8 +134,8 @@ class UndulatorCoupledDoubleCrystalMonoEnergy(Adjustable):
# def enable_ebeam_coupling(self): # def enable_ebeam_coupling(self):
# self.pvs.ebeam_coupling.put(1) # self.pvs.ebeam_coupling.put(1)
def disable_ebeam_coupling(self): # def disable_ebeam_coupling(self):
self.pvs.ebeam_coupling.put(0) # self.pvs.ebeam_coupling.put(0)
# @property # @property
# def ebeam_coupling(self): # def ebeam_coupling(self):
@@ -224,10 +225,11 @@ class UndulatorCoupledDoubleCrystalMonoEnergyWithTimeCorrection(Adjustable):
timing.set_target_value(target_delay).wait() timing.set_target_value(target_delay).wait()
self.move_and_wait(value) self.move_and_wait(value)
sleep(3) # wait so that the set value has changed sleep(1) # wait so that the set value has changed
print("start waiting for DCM") print("start waiting for DCM")
while self.is_moving(): #TODO: moving PV seems broken while self.is_moving(): #TODO: moving PV seems broken
print("mono is moving")
sleep(wait_time) sleep(wait_time)
# print("start waiting for electron beam") # print("start waiting for electron beam")
# while abs(self.electron_energy_rb.get() - self.electron_energy_sv.get()) > 0.25: # while abs(self.electron_energy_rb.get() - self.electron_energy_sv.get()) > 0.25:
@@ -239,8 +241,9 @@ class UndulatorCoupledDoubleCrystalMonoEnergyWithTimeCorrection(Adjustable):
self.disable_ebeam_coupling() self.disable_ebeam_coupling()
self.pvs.setvalue.put(value) self.pvs.setvalue.put(value)
self.und.set_target_value(value) self.und.set_target_value(value)
sleep(3) #TODO: is this correct? sleep(1) #TODO: is this correct?
while self.is_moving(): while self.is_moving():
print("mono is moving")
sleep(wait_time) sleep(wait_time)
@@ -263,9 +266,11 @@ class UndulatorCoupledDoubleCrystalMonoEnergyWithTimeCorrection(Adjustable):
# adjust this function!! # adjust this function!!
# be careful, CDCMEWTC has its own conversion!!! # be careful, CDCMEWTC has its own conversion!!!
def convert_E_to_distance(E): ### returns a value in mm! def convert_E_to_distance(E): ### returns a value in mm!
#return 0.0061869 * E ### calibration May 2021, S k-edge, 2450 eV, corresponds to 41.2 fs/eV #return 0.0061869 * E ### calibration May 2021, S k-edge, 2450 eV, corresponds to 41.2 fs/eV --> this is InSb111 in the DCM!
#return 0.00524244 * E ### calibration Nov 2021, Rh L-edge, 3000 eV, corresponds to 35 fs/eV #return 0.00524244 * E ### calibration Nov 2021, Rh L-edge, 3000 eV, corresponds to 35 fs/eV
return 0.0005445 * E ### calibration Mar 2022, Mn K-edge, 6500 eV, corresponds to 3.6 fs/eV #return 0.0005445 * E ### calibration Mar 2022, Mn K-edge, 6500 eV, corresponds to 3.6 fs/eV
return 0.0004692 * E ### calibration Mar 2022, Fe K-edge, 7100 eV, corresponds to 3.13 fs/eV
#return 0.0148402 * E ### calibration May 2022, S K-edge, 2470 eV, corresponds to 99 fs/eV