Skip to content
Snippets Groups Projects
Commit b199cbdf authored by Mauro Trovo's avatar Mauro Trovo :headphones:
Browse files

waist correction add

parent d082e8da
No related branches found
No related tags found
No related merge requests found
...@@ -713,7 +713,7 @@ class EEHGMaster(Device): ...@@ -713,7 +713,7 @@ class EEHGMaster(Device):
self._dlambda_s1 = 1.0 self._dlambda_s1 = 1.0
self._lambda_s1or2_fix = True self._lambda_s1or2_fix = True
self._fl_s1 = True self._fl_s1 = True
self._waist_corr_s1 = float('Nan') self._waist_corr_s1 = 1.0
self._nrg_s1_fix = True self._nrg_s1_fix = True
self._dt_s1 = 200.0 #seed 1 pulse duration in fs self._dt_s1 = 200.0 #seed 1 pulse duration in fs
self._nrg_s1 = float('Nan') self._nrg_s1 = float('Nan')
...@@ -725,7 +725,7 @@ class EEHGMaster(Device): ...@@ -725,7 +725,7 @@ class EEHGMaster(Device):
self._lambda_s2_curr = 255.0 self._lambda_s2_curr = 255.0
self._dlambda_s2 = 1.0 self._dlambda_s2 = 1.0
self._fl_s2 = True self._fl_s2 = True
self._waist_corr_s2 = float('Nan') self._waist_corr_s2 = 1.0
self._dt_s2 = 100.0 #seed 2 pulse duration in fs self._dt_s2 = 100.0 #seed 2 pulse duration in fs
self._nrg_s2 = float('Nan') self._nrg_s2 = float('Nan')
self._nrg_s2_curr = 10.0 self._nrg_s2_curr = 10.0
...@@ -1529,6 +1529,7 @@ class EEHGMaster(Device): ...@@ -1529,6 +1529,7 @@ class EEHGMaster(Device):
def write_waist_corr_s1(self, value): def write_waist_corr_s1(self, value):
# PROTECTED REGION ID(EEHGMaster.waist_corr_s1_write) ENABLED START # # PROTECTED REGION ID(EEHGMaster.waist_corr_s1_write) ENABLED START #
"""Set the waist_corr_s1 attribute.""" """Set the waist_corr_s1 attribute."""
self._waist_corr_s1 = value
pass pass
# PROTECTED REGION END # // EEHGMaster.waist_corr_s1_write # PROTECTED REGION END # // EEHGMaster.waist_corr_s1_write
...@@ -1786,7 +1787,7 @@ class EEHGMaster(Device): ...@@ -1786,7 +1787,7 @@ class EEHGMaster(Device):
mod2 = utl.Undulator(lw = 0.113, lung = 1.469, helical = False, aw = 1.0) mod2 = utl.Undulator(lw = 0.113, lung = 1.469, helical = False, aw = 1.0)
seed1 = utl.Laser(wl = self._lambda_s1_curr * 1e-9, bdw = self._dlambda_s1*1.0e-9, seed1 = utl.Laser(wl = self._lambda_s1_curr * 1e-9, bdw = self._dlambda_s1*1.0e-9,
nrg = self._nrg_s1_curr * 1e-6, waist = self._waist_s1 * 1e-3, nrg = self._nrg_s1_curr * 1e-6, waist = self._waist_s1 * self._waist_corr_s1 * 1e-3,
wl_range = [self._lambda_s1_curr * 1e-9, self._lambda_s1_curr * 1e-9]) wl_range = [self._lambda_s1_curr * 1e-9, self._lambda_s1_curr * 1e-9])
# wl_range matenuto fisso attorno al seed attuale # wl_range matenuto fisso attorno al seed attuale
# wl_range = [self.lambda_s1.get_properties().min_value * 1e-9, # wl_range = [self.lambda_s1.get_properties().min_value * 1e-9,
...@@ -1802,7 +1803,7 @@ class EEHGMaster(Device): ...@@ -1802,7 +1803,7 @@ class EEHGMaster(Device):
A1_curr = seed1.calc_a_from_seedpower(ebeam, mod1, arange = False, printout = printout)[0][0] A1_curr = seed1.calc_a_from_seedpower(ebeam, mod1, arange = False, printout = printout)[0][0]
seed2 = utl.Laser(wl = self._lambda_s2_curr * 1e-9, bdw = self._dlambda_s2 * 1.0e-9, seed2 = utl.Laser(wl = self._lambda_s2_curr * 1e-9, bdw = self._dlambda_s2 * 1.0e-9,
nrg = self._nrg_s2_curr * 1e-6, waist = self._waist_s2 * 1e-3, nrg = self._nrg_s2_curr * 1e-6, waist = self._waist_s2 * self._waist_corr_s2 * 1e-3,
wl_range = [float(self.lambda_s2.get_properties().min_value) * 1e-9, wl_range = [float(self.lambda_s2.get_properties().min_value) * 1e-9,
float(self.lambda_s2.get_properties().max_value) * 1e-9]) float(self.lambda_s2.get_properties().max_value) * 1e-9])
# wl_range = [240 * 1e-9, 265 * 1e-9]) # wl_range = [240 * 1e-9, 265 * 1e-9])
...@@ -2131,8 +2132,35 @@ class EEHGMaster(Device): ...@@ -2131,8 +2132,35 @@ class EEHGMaster(Device):
else: else:
self.set_state(tango.DevState.ALARM) self.set_state(tango.DevState.ALARM)
self.set_status('Alarm, seed ccd2 device not initialized') self.set_status('Alarm, seed ccd2 device not initialized')
return
pass pass
printout = False
ebeam = utl.ElectronBeam(energy = self._e_nrg_fel * 1e9, energyspread = self._e_dgamma_fel * 1e3,
current = 500.0, emittance_n = 1e-6, beamsize=100e-6)
mod1 = utl.Undulator(lw = 0.10, lung = 3.0, helical = False, aw = 1.0)
mod2 = utl.Undulator(lw = 0.113, lung = 1.469, helical = False, aw = 1.0)
seed1 = utl.Laser(wl = self._lambda_s1_curr * 1e-9, bdw = self._dlambda_s1*1.0e-9,
nrg = self._nrg_s1_curr * 1e-6, waist = self._waist_s1 * self._waist_corr_s1 * 1e-3,
wl_range = [self._lambda_s1_curr * 1e-9, self._lambda_s1_curr * 1e-9])
seed1.set_duration(self._dt_s1 * 1e-15)
mod1.calc_aw(seed1.wl, ebeam.energy)
self._a1_curr = seed1.calc_a_from_seedpower(ebeam, mod1, arange = False, printout = printout)[0][0]
seed2 = utl.Laser(wl = self._lambda_s2_curr * 1e-9, bdw = self._dlambda_s2 * 1.0e-9,
nrg = self._nrg_s2_curr * 1e-6, waist = self._waist_s2 * self._waist_corr_s2 * 1e-3,
wl_range = [float(self.lambda_s2.get_properties().min_value) * 1e-9,
float(self.lambda_s2.get_properties().max_value) * 1e-9])
seed2.set_duration(self._dt_s2 * 1e-15)
mod2.calc_aw(seed2.wl, ebeam.energy)
self._a2_curr = seed2.calc_a_from_seedpower(ebeam, mod2, arange = False, printout = printout)[0][0]
self.set_status('Read complited.') self.set_status('Read complited.')
# PROTECTED REGION END # // EEHGMaster.ReadFromField # PROTECTED REGION END # // EEHGMaster.ReadFromField
......
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