forked from mgaug/Muons_DualMirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdualmirror.py
More file actions
376 lines (307 loc) · 16.2 KB
/
dualmirror.py
File metadata and controls
376 lines (307 loc) · 16.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
import matplotlib.pyplot as plt
import numpy as np
from scipy import special
from telescope import *
from setup import *
from plotting import *
SetUp()
tel = SST()
mp.dps = 20 # we use augmented precision in some functions, which may have denominators close to zero
theta_c_deg = 1.3
theta_c = theta_c_deg*np.pi/180.
telescope = tel.name
psi = 180
shadow_conditions_nucycle(psi, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Des,tel.FOV) # without effect of baffles
plt.savefig(f'ShadowConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
plt.show()
psi = 0
shadow_conditions_nucycle(psi, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Des,tel.FOV) # without effect of baffles
plt.savefig(f'ShadowConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
plt.show()
psi = 0
shadow_conditions_nucycle(psi, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Dpb,tel.FOV) # with effect of baffles
plt.savefig(f'ShadowConditions_psi{psi:.0f}_nucycle_Baffles_{telescope:s}.pdf')
plt.show()
psi = 180
shadow_conditions_nucycle(psi, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Dpb,tel.FOV) # with effect of baffles
plt.savefig(f'ShadowConditions_psi{psi:.0f}_nucycle_Baffles_{telescope:s}.pdf')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
shadow_conditions_psicycle(nu_deg, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Des,tel.FOV) # without effect of baffles
plt.savefig(f'ShadowConditions_nu{nu_deg:.0f}_psicycle_{telescope:s}.pdf')
plt.show()
shadow_conditions_psicycle(nu_deg, theta_c, tel.R1,tel.Rsb,tel.Des,tel.Dpb,tel.FOV) # with effect of baffles
plt.savefig(f'ShadowConditions_nu{nu_deg:.0f}_psicycle_Baffles_{telescope:s}.pdf')
plt.show()
psi = 0
baffle_conditions_nucycle(psi,tel.R1,tel.Rsb,tel.Des,tel.Dpb,theta_c)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'BaffleConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
plt.show()
psi = 180
baffle_conditions_nucycle(psi,tel.R1,tel.Rsb,tel.Des,tel.Dpb,theta_c)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'BaffleConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
baffle_conditions_psicycle(nu_deg,tel.R1,tel.Rsb,tel.Des,tel.Dpb,theta_c)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'BaffleConditions_nu{nu_deg:.1f}_psicycle_{telescope:s}.pdf')
plt.show()
#nu_deg = 0
#psi = 0
#shadow_conditions_nucycle(psi, theta_c, R1,Rsb,Des,Dpb,tit='')
#nu_deg = 4
#shadow_conditions_nucycle(psi, theta_c, R1,Rsb,Des,Dpb,tit='')
#nu_deg = 4
#psi = 180
#shadow_conditions_nucycle(psi, theta_c, R1,Rsb,Des,Dpb,tit='')
nu_deg = 0
psi = 0
Lmaxmin2_vs_LVacanti_shadow_relative(nu_deg, psi,theta_c,tel.R1,tel.Rhole,tel.Des,tel.Dpb,1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_relVacanti_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmaxmin2_vs_LVacanti_shadow_relative(nu_deg, psi,theta_c,tel.R1,tel.Rhole,tel.Des,tel.Dpb,1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_relVacanti_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmaxmin2_vs_LVacanti_shadow_relative(nu_deg, psi,theta_c,tel.R1,tel.Rhole,tel.Des,tel.Dpb,1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_relVacanti_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = 0
psi = 0
Lmaxmin2_vs_Lmaxmin_shadow_relative(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_rel_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmaxmin2_vs_Lmaxmin_shadow_relative(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_rel_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmaxmin2_vs_Lmaxmin_shadow_relative(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_rel_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = 0
psi = 0
Lmaxmin2_vs_Lmaxmin_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmaxmin2_vs_Lmaxmin_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmaxmin2_vs_Lmaxmin_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax1max2min2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = 0
psi = 0
Lmaxmin2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmaxmin2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmaxmin2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp, tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmaxmin2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmaxmin2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp, tel.Dps,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmaxmin2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = 0
psi = 0
Lmax2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmax2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmax2_shadow_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rsb/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmax2_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = 0
psi = 0
Lmin_hole_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb, tel.Dps)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmin_HoleConditions_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
nu_deg = np.ceil(tel.FOV/2-theta_c_deg)
psi = 0
Lmin_hole_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb, tel.Dps)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmin_HoleConditions_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
psi = 180
Lmin_hole_absolute(nu_deg, psi, theta_c, tel.R1,tel.Rhole,tel.Des,tel.Dpb, 1./4./tel.Fp,tel.Rsb, tel.Dps)
ax = plt.gca()
circle = plt.Circle((0., 0.), tel.Rhole/tel.R1, transform=ax.transData._b, color="k", alpha=0.2)
ax.add_artist(circle)
plt.savefig(f'Lmin_HoleConditions_psi{psi:.0f}_nu{nu_deg:.1f}_{telescope:s}.png')
plt.show()
#psi = 0
#hole_conditions_nucycle(psi, theta_c, R1,Rhole,Des,1./4./Fp)
#ax = plt.gca()
#circle = plt.Circle((0., 0.), Rhole/R1, transform=ax.transData._b, color="k", alpha=0.2)
#ax.add_artist(circle)
#plt.savefig(f'HoleConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
#plt.show()
#psi = 180
#hole_conditions_nucycle(psi, theta_c, R1,Rhole,Des,1./4./Fp)
#ax = plt.gca()
#circle = plt.Circle((0., 0.), Rhole/R1, transform=ax.transData._b, color="k", alpha=0.2)
#ax.add_artist(circle)
#plt.savefig(f'HoleConditions_psi{psi:.0f}_nucycle_{telescope:s}.pdf')
#plt.show()
#nu_deg = np.floor(tel.FOV/2-theta_c)
#hole_conditions_psicycle(nu_deg, theta_c, R1,Rhole,Des,1./4./Fp)
#ax = plt.gca()
#circle = plt.Circle((0., 0.), Rhole/R1, transform=ax.transData._b, color="k", alpha=0.2)
#ax.add_artist(circle)
#plt.savefig(f'HoleConditions_nu{nu_deg:.0f}_psicycle_{telescope:s}.pdf')
#plt.show()
fig, ax = plt.subplots()
fig.subplots_adjust(right=0.75)
rhoR = np.arange(0.001,1.05,0.0995, dtype=np.float64)
psi = 90
# total
tot = 4 * special.ellipe(rhoR**2) * tel.R1**2 / theta_c
totcorr = 2*np.pi/4./tel.Fp * tel.R1**2 * (1-rhoR**2) * (1 - 2*np.cos(psi) / rhoR * (special.ellipk(rhoR**2) - special.ellipe(rhoR**2)))
phi = 0
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 45
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 90
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 135
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 180
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 225
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 270
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 315
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
ax.plot(rhoR, totcorr/tot,'--',color='k', label='integrated \n over all'+r' $\phi$')
ax.legend(loc='center left', fontsize=15,bbox_to_anchor=(0.95, 0.5))
ax.set_title(rf'SST for $\nu$={nu*180/np.pi:.0f}$^\circ$, $\theta_c$={theta_c*180/np.pi:.1f}$^\circ$, $\psi$={psi:.0f}')
ax.set_xlabel(r'$\rho_R$')
ax.set_ylabel(r'$\Delta L_{max}^{(1)}/L_{max}^{(0)}$')
plt.savefig(f'LMax2Correction_{telescope:s}_{psi:d}.pdf', bbox_inches='tight')
plt.show()
fig, ax = plt.subplots(figsize=(6,6))
fig.subplots_adjust(right=0.99)
psi = 0
totcorr = 2*np.pi/4./tel.Fp * tel.R1**2 * (1-rhoR**2) * (1 - 2*np.cos(psi) / rhoR * (special.ellipk(rhoR**2) - special.ellipe(rhoR**2)))
phi = 0
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 45
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 90
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 135
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 180
ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
#phi = 225
#ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
#phi = 270
#ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
#phi = 315
#ax.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp,nu,psi)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
#ax.legend(loc='center left', fontsize=15,bbox_to_anchor=(0.95, 0.5))
ax.plot(rhoR, totcorr/tot,'--',color='k', label='integrated \n over all'+r' $\phi$')
ax.set_title(rf'SST for $\nu$={nu*180/np.pi:.0f}$^\circ$, $\theta_c$={theta_c*180/np.pi:.1f}$^\circ$, $\psi$={psi:.0f}')
ax.set_xlabel(r'$\rho_R$')
ax.set_ylabel(r'$\Delta L_{max}^{(1)}/L_{max}^{(0)}$')
plt.savefig(f'LMax2Correction_{telescope:s}_{psi:d}.pdf', bbox_inches='tight')
plt.show()
phi = 0
nu = 0
#plt.plot(rhoR, Lmax(rhoR,phi,R1,theta_c,1./4./Fp), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
Lmax_s = Lmax(rhoR,phi,tel.R1,theta_c)
Lmax_w = Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)
dff = (Lmax_w - Lmax_s)/Lmax_s
print ('Lmax_s: ', Lmax_s, ' Lmax_w: ',Lmax_w, ' dff: ', dff)
plt.plot(rhoR,dff, label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 45
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 90
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 135
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 180
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 225
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 270
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
phi = 315
plt.plot(rhoR, (Lmax(rhoR,phi,tel.R1,theta_c,1./4./tel.Fp)-Lmax(rhoR,phi,tel.R1,theta_c))/Lmax(rhoR,phi,tel.R1,theta_c), label=r'$\phi-\phi_{0}=$'+f'{phi:d}'+r'$^{\circ}$')
plt.legend(loc='best', fontsize=15)
plt.xlabel(r'$\rho_R$')
plt.ylabel(r'$L_{max} (c-corr.)/L_{max}$ (Vacanti)')
plt.savefig('LMaxCorrection_c_{telescope:s}.pdf', bbox_inches='tight')
plt.show()