Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eehg-master
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs
ds
eehg-master
Commits
b199cbdf
Commit
b199cbdf
authored
1 week ago
by
Mauro Trovo
Browse files
Options
Downloads
Patches
Plain Diff
waist correction add
parent
d082e8da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/EEHGMaster.py
+33
-5
33 additions, 5 deletions
src/EEHGMaster.py
with
33 additions
and
5 deletions
src/EEHGMaster.py
+
33
−
5
View file @
b199cbdf
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment