|
1 # This Python script will be executed from within the main calc_lidar_correction_parameters_G_H_K.py |
|
2 # Probably it will be better in the future to let the main script rather read a conguration file, which might improve the portability of the code within an executable. |
|
3 # Due to problems I had with some two letter variables, most variables are now with at least three letters mixed small and capital. |
|
4 |
|
5 # Header to identify the lidar system |
|
6 # Values of DO, DT, and DR etc. from fit to lamp calibrations in Leipzig (LampCalib_2_invers_c_D0=0.opj) |
|
7 EID = "oh" # Earlinet station ID |
|
8 LID = "POLLY_XT_RALPH LampCalib_2_invers_c_DO=0.opj ver8c-7" # Additional lidar ID (short descriptive text) |
|
9 # firet fit intern (FITLN1) => DO = 0, DT fixed -0.9998, eta and DR fitted, |
|
10 # => internal calib with LinPol before the receiver |
|
11 print(" Lidar system :", EID, ", ", LID) |
|
12 |
|
13 |
|
14 # --- IL Laser IL and +-Uncertainty |
|
15 bL = 1. #degree of linear polarization; default 1 |
|
16 RotL, dRotL, nRotL = 90, 1., 0 #alpha; rotation of laser polarization in degrees; default 0 |
|
17 # --- ME Emitter and +-Uncertainty |
|
18 DiE, dDiE, nDiE = 0., 0.1, 0 # Diattenuation |
|
19 TiE = 1. # Unpolarized transmittance |
|
20 RetE, dRetE, nRetE = 0., 180.0, 0 # Retardance in degrees |
|
21 RotE, dRotE, nRotE = 0., 1.0, 0 # beta: Rotation of optical element in degrees |
|
22 |
|
23 # --- MO Receiver Optics including telescope |
|
24 DiO, dDiO, nDiO = 0.0, 0.0022, 0 |
|
25 TiO = 1.0 |
|
26 RetO, dRetO, nRetO = 0., 180.0, 0 |
|
27 RotO, dRotO, nRotO = 0., 0.5, 0 #gamma |
|
28 |
|
29 # --- PBS MT transmitting path defined with (TS,TP); and +-Uncertainty |
|
30 # --- Pol.Filter |
|
31 ERaT, dERaT, nERaT = 0.0001, 0.0001, 1 # Extinction ratio |
|
32 RotaT, dRotaT, nRotaT = 90., 2., 0 # Rotation of the pol.-filter in degrees |
|
33 DaT = (1-ERaT)/(1+ERaT) |
|
34 TaT = 0.5*(1+ERaT) |
|
35 # --- PBS combined with Pol.Filter |
|
36 TP, dTP, nTP = 0.512175, 0.0024, 1 |
|
37 TS, dTS, nTS = 1-TP, 0.02, 0 |
|
38 TiT = 0.5 * (TP + TS) |
|
39 DiT = (TP-TS)/(TP+TS) |
|
40 RetT, dRetT, nRetT = 0., 180., 0 # Retardance in degrees |
|
41 |
|
42 # --- PBS MR reflecting path defined with (RS,RP); and +-Uncertainty |
|
43 # --- Pol.Filter |
|
44 ERaR, dERaR, nERaR = 1, 0.003, 0 |
|
45 RotaR, dRotaR, nRotaR = 0., 2., 0 |
|
46 DaR = (1-ERaR)/(1+ERaR) |
|
47 TaR = 0.5*(1+ERaR) |
|
48 # --- PBS 50/50 |
|
49 RP, dRP, nRP = 1-TP, 0.02, 0 |
|
50 RS, dRS, nRS = 1-TS, 0.00, 0 |
|
51 RetR, dRetR, nRetR = 0., 180., 0 |
|
52 TiR = 0.5 * (RP + RS) |
|
53 DiR = (RP-RS)/(RP+RS) |
|
54 |
|
55 # --- Parallel signal detected in the transmitted channel => Y = 1, or in the reflected channel => Y = -1 |
|
56 Y = -1. |
|
57 |
|
58 # --- Calibrator Location |
|
59 LocC = 3 #location of calibrator: 1 = behind laser; 2 = behind emitter; 3 = before receiver; 4 = before PBS |
|
60 # --- Calibrator Type used; defined by matrix values below |
|
61 TypeC = 3 #Type of calibrator: 1 = mechanical rotator; 2 = hwp rotator (fixed retardation); 3 = linear polarizer; 4 = qwp; 5 = circular polarizer; 6 = real HWP calibration +-22.5° |
|
62 # --- MC Calibrator |
|
63 if TypeC == 1: #mechanical rotator |
|
64 DiC, dDiC, nDiC = 0., 0., 0 |
|
65 TiC = 1. |
|
66 RetC, dRetC, nRetC = 0., 0., 0 |
|
67 RotC, dRotC, nRotC = 0., 0.1, 1 #constant calibrator offset epsilon |
|
68 # Rotation error without calibrator: if False, then epsilon = 0 for normal measurements |
|
69 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 1 calibrator |
|
70 elif TypeC == 2: # HWP rotator |
|
71 DiC, dDiC, nDiC = 0., 0., 0 |
|
72 TiC = 1. |
|
73 RetC, dRetC, nRetC = 180., 0., 0 |
|
74 #NOTE: use here twice the HWP-rotation-angle |
|
75 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator offset epsilon |
|
76 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 2 calibrator |
|
77 elif TypeC == 3: # linear polarizer calibrator |
|
78 DiC, dDiC, nDiC = 0.9998, 0.0001, 1 # ideal 1.0 |
|
79 TiC = 0.505 # ideal 0.5 |
|
80 RetC, dRetC, nRetC = 0., 0., 0 |
|
81 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator offset epsilon |
|
82 RotationErrorEpsilonForNormalMeasurements = False # is in general False for TypeC == 3 calibrator |
|
83 elif TypeC == 4: # QWP calibrator |
|
84 DiC, dDiC, nDiC = 0.0, 0., 0 # ideal 1.0 |
|
85 TiC = 1.0 # ideal 0.5 |
|
86 RetC, dRetC, nRetC = 90., 0., 0 |
|
87 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator offset epsilon |
|
88 RotationErrorEpsilonForNormalMeasurements = False # is False for TypeC == 4 calibrator |
|
89 elif TypeC == 6: # real half-wave plate calibration at +-22.5° => rotated_diattenuator_X22x5deg.odt |
|
90 DiC, dDiC, nDiC = 0., 0., 0 |
|
91 TiC = 1. |
|
92 RetC, dRetC, nRetC = 180., 0., 0 |
|
93 #Note: use real HWP angles here |
|
94 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator offset epsilon -1.15 |
|
95 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 6 calibrator |
|
96 else: |
|
97 print ('calibrator not implemented yet') |
|
98 sys.exit() |
|
99 |
|
100 # --- LDRCal assumed atmospheric linear depolarization ratio during the calibration measurements (first guess) |
|
101 LDRCal,dLDRCal,nLDRCal= 0.006, 0.02, 1 |
|
102 |
|
103 # ==================================================== |
|
104 # NOTE: there is no need to change anything below. |
|
105 |
|
106 # --- LDRtrue for simulation of measurement => LDRsim |
|
107 LDRtrue = 0.4 |
|
108 LDRtrue2 = 0.004 |
|
109 |
|
110 # --- measured LDRm will be corrected with calculated parameters GHK |
|
111 LDRmeas = 0.3 |
|
112 |
|
113 # --- this is just for correct transfer of the variables to the main file |
|
114 RotL0, dRotL, nRotL = RotL, dRotL, nRotL |
|
115 # Emitter |
|
116 DiE0, dDiE, nDiE = DiE, dDiE, nDiE |
|
117 RetE0, dRetE, nRetE = RetE, dRetE, nRetE |
|
118 RotE0, dRotE, nRotE = RotE, dRotE, nRotE |
|
119 # Receiver |
|
120 DiO0, dDiO, nDiO = DiO, dDiO, nDiO |
|
121 RetO0, dRetO, nRetO = RetO, dRetO, nRetO |
|
122 RotO0, dRotO, nRotO = RotO, dRotO, nRotO |
|
123 # Calibrator |
|
124 DiC0, dDiC, nDiC = DiC, dDiC, nDiC |
|
125 RetC0, dRetC, nRetC = RetC, dRetC, nRetC |
|
126 RotC0, dRotC, nRotC = RotC, dRotC, nRotC |
|
127 # PBS |
|
128 TP0, dTP, nTP = TP, dTP, nTP |
|
129 TS0, dTS, nTS = TS, dTS, nTS |
|
130 RetT0, dRetT, nRetT = RetT, dRetT, nRetT |
|
131 |
|
132 ERaT0, dERaT, nERaT = ERaT, dERaT, nERaT |
|
133 RotaT0,dRotaT,nRotaT= RotaT,dRotaT,nRotaT |
|
134 |
|
135 RP0, dRP, nRP = RP, dRP, nRP |
|
136 RS0, dRS, nRS = RS, dRS, nRS |
|
137 RetR0, dRetR, nRetR = RetR, dRetR, nRetR |
|
138 |
|
139 ERaR0, dERaR, nERaR = ERaR, dERaR, nERaR |
|
140 RotaR0,dRotaR,nRotaR= RotaR,dRotaR,nRotaR |
|
141 |
|
142 LDRCal0,dLDRCal,nLDRCal=LDRCal,dLDRCal,nLDRCal |