system_settings/optic_input_example_lidar.py

Fri, 24 Nov 2017 22:54:15 +0100

author
Volker Freudenthaler <volker.freudenthaler@lmu.de>
date
Fri, 24 Nov 2017 22:54:15 +0100
changeset 27
e7b3f4bf631d
parent 26
28b5510492ba
child 28
79fa4a41420f
permissions
-rw-r--r--

Added tag 0.9.6 for changeset 28b5510492ba

volker@12 1 # This Python script will be executed from within the main lidar_correction_ghk.py
volker@12 2 # Probably it will be better in the future to let the main script rather read a conguration file,
volker@12 3 # which might improve the portability of the code within an executable.
volker@12 4 # Due to problems I had with some two letter variables, most variables are now with at least
volker@12 5 # three letters mixed small and capital.
volker@23 6 # To be used with lidar_correction_ghk.py ver. 0.9.5 and larger
volker@12 7
volker@16 8 # Do you want to calculate the errors? If not, just the GHK-parameters are determined.
volker@16 9 Error_Calc = True
volker@16 10
volker@12 11 # Header to identify the lidar system
volker@17 12 #
volker@12 13 EID = "xx" # Earlinet station ID
volker@12 14 LID = "example lidar" # Additional lidar ID (short descriptive text)
volker@12 15 print(" Lidar system :", EID, ", ", LID)
volker@12 16
volker@13 17 # +++ IL Laser and +-Uncertainty
volker@23 18 DOLP, dDOLP, nDOLP = 0.995, 0.005, 1 #degree of linear polarization; default 1
volker@16 19 RotL, dRotL, nRotL = 0., 2., 1 #alpha; rotation of laser polarization in degrees; default 0
volker@13 20
volker@13 21 # +++ ME Emitter optics and +-Uncertainty; default = no emitter optics
volker@13 22 DiE, dDiE, nDiE = 0.0, 0.1, 0 # Diattenuation
volker@13 23 TiE = 1.0 # Unpolarized transmittance
volker@13 24 RetE, dRetE, nRetE = 0., 180., 0 # Retardance in degrees
volker@12 25 RotE, dRotE, nRotE = 0., 1.0, 0 # beta: Rotation of optical element in degrees
volker@12 26
volker@13 27 # +++ MO Receiver optics including telescope
volker@26 28 DiO, dDiO, nDiO = 0.0, 0.1, 1 # Diattenuation
volker@26 29 TiO = 1.0 # Unpolarized transmittance
volker@26 30 RetO, dRetO, nRetO = 0., 180., 0 # Retardance in degrees
volker@26 31 RotO, dRotO, nRotO = 0., 0.5, 0 #gamma: Rotation of the optical element in degrees
volker@13 32
volker@13 33 # +++++ PBS MT Transmitting path defined with TS, TP, PolFilter extinction ratio ERaT, and +-Uncertainty
volker@13 34 # --- Polarizing beam splitter transmitting path
volker@26 35 TP, dTP, nTP = 0.95, 0.01, 1 # transmittance of the PBS for parallel polarized light
volker@26 36 TS, dTS, nTS = 0.02, 0.01, 1 # transmittance of the PBS for cross polarized light
volker@13 37 RetT, dRetT, nRetT = 0.0, 180., 0 # Retardance in degrees
volker@13 38 # --- Pol.Filter behind transmitted path of PBS
volker@16 39 ERaT, dERaT, nERaT = 0.001, 0.001, 1 # Extinction ratio
volker@26 40 RotaT, dRotaT, nRotaT = 0., 1., 1 # Rotation of the Pol.-filter in degrees; usually close to 0° because TP >> TS, but for PollyXTs it can also be close to 90°
volker@13 41 # --
volker@12 42 TiT = 0.5 * (TP + TS)
volker@12 43 DiT = (TP-TS)/(TP+TS)
volker@12 44 DaT = (1-ERaT)/(1+ERaT)
volker@13 45 TaT = 0.5*(1+ERaT)
volker@12 46
volker@13 47 # +++++ PBS MR Reflecting path defined with RS, RP, PolFilter extinction ratio ERaR and +-Uncertainty
volker@13 48 # ---- for PBS without absorption the change of RS and RP must depend on the change of TP and TS. Hence the values and uncertainties are not independent.
volker@16 49 RS_RP_depend_on_TS_TP = False
volker@13 50 # --- Polarizing beam splitter reflecting path
volker@13 51 if(RS_RP_depend_on_TS_TP):
volker@13 52 RP, dRP, nRP = 1-TP, 0.00, 0 # do not change this
volker@13 53 RS, dRS, nRS = 1-TS, 0.00, 0 # do not change this
volker@13 54 else:
volker@26 55 RP, dRP, nRP = 0.05, 0.01, 1 # change this if RS_RP_depend_on_TS_TP = False; reflectance of the PBS for parallel polarized light
volker@26 56 RS, dRS, nRS = 0.98, 0.01, 1 # change this if RS_RP_depend_on_TS_TP = False; reflectance of the PBS for cross polarized light
volker@26 57 RetR, dRetR, nRetR = 0.0, 180., 0 # Retardance in degrees
volker@13 58 # --- Pol.Filter behind reflected path of PBS
volker@16 59 ERaR, dERaR, nERaR = 0.001, 0.001, 1 # Extinction ratio
volker@16 60 RotaR, dRotaR, nRotaR = 90., 1., 1 # Rotation of the Pol.-filter in degrees; usually 90° because RS >> RP, but for PollyXTs it can also be 0°
volker@13 61 # --
volker@12 62 TiR = 0.5 * (RP + RS)
volker@12 63 DiR = (RP-RS)/(RP+RS)
volker@12 64 DaR = (1-ERaR)/(1+ERaR)
volker@13 65 TaR = 0.5*(1+ERaR)
volker@12 66
volker@26 67 # +++ Orientation of the PBS with respect to the reference plane (see Polarisation-orientation.png and Polarisation-orientation-2.png in /system_settings)
volker@26 68 # Y = +1: polarisation in reference plane is transmitted,
volker@26 69 # Y = -1: polarisation in reference plane is reflected.
volker@13 70 Y = +1.
volker@12 71
volker@13 72 # +++ Calibrator Location
volker@12 73 LocC = 3 #location of calibrator: 1 = behind laser; 2 = behind emitter; 3 = before receiver; 4 = before PBS
volker@12 74 # --- Calibrator Type used; defined by matrix values below
volker@12 75 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°
volker@13 76 # --- MC Calibrator parameters
volker@12 77 if TypeC == 1: #mechanical rotator
volker@26 78 DiC, dDiC, nDiC = 0., 0., 0 # Diattenuation
volker@12 79 TiC = 1.
volker@26 80 RetC, dRetC, nRetC = 0., 0., 0 # Retardance in degrees
volker@26 81 RotC, dRotC, nRotC = 0., 0.1, 1 #constant calibrator rotation offset epsilon
volker@12 82 # Rotation error without calibrator: if False, then epsilon = 0 for normal measurements
volker@12 83 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 1 calibrator
volker@26 84 elif TypeC == 2: # HWP rotator without retardance!
volker@26 85 DiC, dDiC, nDiC = 0., 0., 0 # Diattenuation; ideal 0.0
volker@12 86 TiC = 1.
volker@26 87 RetC, dRetC, nRetC = 180., 0., 0 # Retardance in degrees
volker@12 88 #NOTE: use here twice the HWP-rotation-angle
volker@26 89 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator rotation offset epsilon
volker@12 90 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 2 calibrator
volker@16 91 elif TypeC == 3: # linear polarizer calibrator. Diattenuation DiC = (1-ERC)/(1+ERC); ERC = extinction ratio of calibrator
volker@26 92 DiC, dDiC, nDiC = 0.9998, 0.0001, 1 # Diattenuation; ideal 1.0
volker@16 93 TiC = 0.4 # ideal 0.5
volker@26 94 RetC, dRetC, nRetC = 0., 0., 0 # Retardance in degrees
volker@26 95 RotC, dRotC, nRotC = 0.0, 0.1, 0 #constant calibrator rotation offset epsilon
volker@12 96 RotationErrorEpsilonForNormalMeasurements = False # is in general False for TypeC == 3 calibrator
volker@12 97 elif TypeC == 4: # QWP calibrator
volker@26 98 DiC, dDiC, nDiC = 0.0, 0., 0 # Diattenuation; ideal 0.0
volker@12 99 TiC = 1.0 # ideal 0.5
volker@26 100 RetC, dRetC, nRetC = 90., 0., 0 # Retardance in degrees
volker@26 101 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator rotation offset epsilon
volker@12 102 RotationErrorEpsilonForNormalMeasurements = False # is False for TypeC == 4 calibrator
volker@26 103 elif TypeC == 6: # real half-wave plate rotator calibration at +-22.5° => rotated_diattenuator_X22x5deg.odt
volker@26 104 DiC, dDiC, nDiC = 0., 0., 0 # Diattenuation; ideal 0.0
volker@12 105 TiC = 1.
volker@26 106 RetC, dRetC, nRetC = 180., 0., 0 # Retardance in degrees
volker@12 107 #Note: use real HWP angles here
volker@26 108 RotC, dRotC, nRotC = 0.0, 0.1, 1 #constant calibrator rotation offset epsilon
volker@12 109 RotationErrorEpsilonForNormalMeasurements = True # is in general True for TypeC == 6 calibrator
volker@12 110 else:
volker@12 111 print ('calibrator not implemented yet')
volker@12 112 sys.exit()
volker@12 113
volker@16 114 # --- LDRCal assumed atmospheric linear depolarization ratio during the calibration measurements in calibration range with almost clean air (first guess)
volker@16 115 LDRCal,dLDRCal,nLDRCal= 0.009, 0.005, 1 # spans the interference filter influence
volker@21 116
volker@12 117 # ====================================================
volker@12 118 # NOTE: there is no need to change anything below.
volker@12 119
volker@12 120 # --- LDRtrue for simulation of measurement => LDRsim
volker@12 121 LDRtrue = 0.4
volker@12 122 LDRtrue2 = 0.004
volker@12 123
volker@12 124 # --- measured LDRm will be corrected with calculated parameters GHK
volker@12 125 LDRmeas = 0.3
volker@12 126
volker@12 127 # --- this is just for correct transfer of the variables to the main file
volker@23 128 DOLP0, dDOLP, nDOLP = DOLP, dDOLP, nDOLP
volker@12 129 RotL0, dRotL, nRotL = RotL, dRotL, nRotL
volker@12 130 # Emitter
volker@12 131 DiE0, dDiE, nDiE = DiE, dDiE, nDiE
volker@12 132 RetE0, dRetE, nRetE = RetE, dRetE, nRetE
volker@12 133 RotE0, dRotE, nRotE = RotE, dRotE, nRotE
volker@12 134 # Receiver
volker@12 135 DiO0, dDiO, nDiO = DiO, dDiO, nDiO
volker@12 136 RetO0, dRetO, nRetO = RetO, dRetO, nRetO
volker@12 137 RotO0, dRotO, nRotO = RotO, dRotO, nRotO
volker@12 138 # Calibrator
volker@12 139 DiC0, dDiC, nDiC = DiC, dDiC, nDiC
volker@12 140 RetC0, dRetC, nRetC = RetC, dRetC, nRetC
volker@12 141 RotC0, dRotC, nRotC = RotC, dRotC, nRotC
volker@12 142 # PBS
volker@12 143 TP0, dTP, nTP = TP, dTP, nTP
volker@12 144 TS0, dTS, nTS = TS, dTS, nTS
volker@12 145 RetT0, dRetT, nRetT = RetT, dRetT, nRetT
volker@12 146
volker@12 147 ERaT0, dERaT, nERaT = ERaT, dERaT, nERaT
volker@12 148 RotaT0,dRotaT,nRotaT= RotaT,dRotaT,nRotaT
volker@12 149
volker@12 150 RP0, dRP, nRP = RP, dRP, nRP
volker@12 151 RS0, dRS, nRS = RS, dRS, nRS
volker@12 152 RetR0, dRetR, nRetR = RetR, dRetR, nRetR
volker@12 153
volker@12 154 ERaR0, dERaR, nERaR = ERaR, dERaR, nERaR
volker@12 155 RotaR0,dRotaR,nRotaR= RotaR,dRotaR,nRotaR
volker@12 156
volker@12 157 LDRCal0,dLDRCal,nLDRCal=LDRCal,dLDRCal,nLDRCal

mercurial