Skip to content

Commit

Permalink
Fix #2445 drift propagation parameters
Browse files Browse the repository at this point in the history
Update due to changes to SRW: ochubar/SRW#24
  • Loading branch information
robnagler committed Apr 15, 2020
1 parent 19749da commit 57f7ae6
Show file tree
Hide file tree
Showing 26 changed files with 673 additions and 193 deletions.
2 changes: 1 addition & 1 deletion sirepo/template/srw_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def _patch_mirror_profile(code, mirror_file='mirror_1d.dat'):
final_mirror_file = None
var_name = 'ifn' + var_name
for i in range(len(code_list)):
if re.search('^(\s*)' + var_name + '(\d*)(\s*)=(\s*)(.*\.dat\w*)(\s*)', code_list[i]):
if re.search(r'^(\s*)' + var_name + r'(\d*)(\s*)=(\s*)(.*\.dat\w*)(\s*)', code_list[i]):
full_var_name = code_list[i].strip().split('=')[0].strip()
code_list[i] = code_list[i].replace(
full_var_name,
Expand Down
40 changes: 36 additions & 4 deletions tests/template/srw_import_data/amx.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"3": [
Expand All @@ -322,7 +330,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"4": [
Expand Down Expand Up @@ -409,7 +425,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"7": [
Expand Down Expand Up @@ -466,7 +490,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
]
},
Expand Down
4 changes: 2 additions & 2 deletions tests/template/srw_import_data/amx.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def set_optics(_v):
#print('DCM Fourier Components:', psi)

#---------------------- DCM Crystal #1
opCr1 = SRWLOptCryst(_d_sp=dc, _psi0r=psi[0], _psi0i=psi[1], _psi_hr=psi[2], _psi_hi=psi[3], _psi_hbr=psi[2], _psi_hbi=psi[3], _tc=tc, _ang_as=angAs)
opCr1 = SRWLOptCryst(_d_sp=dc, _psi0r=psi[0], _psi0i=psi[1], _psi_hr=psi[2], _psi_hi=psi[3], _psi_hbr=psi[2], _psi_hbi=psi[3], _tc=tc, _ang_as=angAs, _ang_roll=1.5707963)

#Find appropriate orientation of the Crystal #1 and the Output Beam Frame (using a member-function in SRWLOptCryst):
orientDataCr1 = opCr1.find_orient(_en=_v.op_DCM_e, _ang_dif_pl=1.5707963) # Horizontally-deflecting
Expand Down Expand Up @@ -184,7 +184,7 @@ def set_optics(_v):
el.append(opCr1); pp.append(_v.op_DCMC1_pp)

#---------------------- DCM Crystal #2
opCr2 = SRWLOptCryst(_d_sp=dc, _psi0r=psi[0], _psi0i=psi[1], _psi_hr=psi[2], _psi_hi=psi[3], _psi_hbr=psi[2], _psi_hbi=psi[3], _tc=tc, _ang_as=angAs)
opCr2 = SRWLOptCryst(_d_sp=dc, _psi0r=psi[0], _psi0i=psi[1], _psi_hr=psi[2], _psi_hi=psi[3], _psi_hbr=psi[2], _psi_hbi=psi[3], _tc=tc, _ang_as=angAs, _ang_roll=-1.5707963)

#Find appropriate orientation of the Crystal #2 and the Output Beam Frame
orientDataCr2 = opCr2.find_orient(_en=_v.op_DCM_e, _ang_dif_pl=-1.5707963)
Expand Down
40 changes: 36 additions & 4 deletions tests/template/srw_import_data/amx_bl2.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"3": [
Expand All @@ -322,7 +330,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"4": [
Expand Down Expand Up @@ -409,7 +425,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"7": [
Expand Down Expand Up @@ -466,7 +490,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
]
},
Expand Down
40 changes: 36 additions & 4 deletions tests/template/srw_import_data/amx_bl3.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"3": [
Expand All @@ -328,7 +336,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"4": [
Expand Down Expand Up @@ -415,7 +431,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"7": [
Expand Down Expand Up @@ -502,7 +526,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
]
},
Expand Down
30 changes: 27 additions & 3 deletions tests/template/srw_import_data/amx_bl4.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"3": [
Expand All @@ -268,7 +276,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"4": [
Expand Down Expand Up @@ -385,7 +401,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
]
},
Expand Down
40 changes: 36 additions & 4 deletions tests/template/srw_import_data/chx.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"2": [
Expand All @@ -345,7 +353,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"3": [
Expand Down Expand Up @@ -462,7 +478,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"7": [
Expand Down Expand Up @@ -519,7 +543,15 @@
1.0,
1.0,
1.0,
1.0
1.0,
0,
0,
0,
0,
0,
0,
0,
0
]
],
"9": [
Expand Down
Loading

0 comments on commit 57f7ae6

Please sign in to comment.