lidar_correction_ghk.py

changeset 26
28b5510492ba
parent 25
4c66b9ca23be
child 28
79fa4a41420f
equal deleted inserted replaced
25:4c66b9ca23be 26:28b5510492ba
201 201
202 # end of initial definition of variables 202 # end of initial definition of variables
203 # ******************************************************************************************************************************* 203 # *******************************************************************************************************************************
204 204
205 # --- Read actual lidar system parameters from optic_input.py (should be in sub-directory 'system_settings') 205 # --- Read actual lidar system parameters from optic_input.py (should be in sub-directory 'system_settings')
206 InputFile = 'optic_input_example_lidar.py' 206 InputFile = 'optic_input_crossed_mirrors_test.py'
207 207 InputFile = 'optic_input_crossed_mirrors_test_combined.py'
208 InputFile = 'optic_input_ver8c_POLIS_355_Mar2017.py'
209 # InputFile = 'optic_input_ver8c_POLIS_532_Mar2017.py'
210 InputFile = 'optic_input_example_lidar_0.9.5.py'
211 InputFile = 'optic_input_ver8c_PollyXT_532_Lacros.py'
212 InputFile = 'optic_input_ver8c_CUT_532_May2017.py'
213 InputFile = 'optic_input_ver8c_MUSA.py'
214 InputFile = 'optic_input_ver10_RALI_JA.py'
215 InputFile = 'optic_input_ver10_RALI_act.py'
216 InputFile = 'optic_input_ver8c-IPRAL-170331.py'
208 ''' 217 '''
209 print("From ", dname) 218 print("From ", dname)
210 print("Running ", fname) 219 print("Running ", fname)
211 print("Reading input file ", InputFile, " for") 220 print("Reading input file ", InputFile, " for")
212 ''' 221 '''
823 Ir = TaR * TiR * TiO * TiE * (GR + atrue * HR) 832 Ir = TaR * TiR * TiO * TiE * (GR + atrue * HR)
824 # LDRsim = 1/Eta*Ir/It # simulated LDR* with Y from input file 833 # LDRsim = 1/Eta*Ir/It # simulated LDR* with Y from input file
825 LDRsim = Ir / It # simulated uncorrected LDR with Y from input file 834 LDRsim = Ir / It # simulated uncorrected LDR with Y from input file
826 # Corrected LDRsimCorr from forward simulated LDRsim (atrue) 835 # Corrected LDRsimCorr from forward simulated LDRsim (atrue)
827 # LDRsimCorr = (1./Eta*LDRsim*(GT+HT)-(GR+HR))/((GR-HR)-1./Eta*LDRsim*(GT-HT)) 836 # LDRsimCorr = (1./Eta*LDRsim*(GT+HT)-(GR+HR))/((GR-HR)-1./Eta*LDRsim*(GT-HT))
828 if Y == -1.: 837 '''
829 LDRsimx = 1. / LDRsim 838 if ((Y == -1.) and (abs(RotL0) < 45)) or ((Y == +1.) and (abs(RotL0) > 45)):
839 LDRsimx = 1. / LDRsim / Etax
830 else: 840 else:
831 LDRsimx = LDRsim 841 LDRsimx = LDRsim / Etax
842 '''
843 LDRsimx = LDRsim
832 844
833 # The following is correct without doubt 845 # The following is correct without doubt
834 # LDRCorr = (LDRsim*K/Etax*(GT+HT)-(GR+HR))/((GR-HR)-LDRsim*K/Etax*(GT-HT)) 846 # LDRCorr = (LDRsim*K/Etax*(GT+HT)-(GR+HR))/((GR-HR)-LDRsim*K/Etax*(GT-HT))
835 847
836 # The following is a test whether the equations for calibration Etax and normal signal (GHK, LDRsim) are consistent 848 # The following is a test whether the equations for calibration Etax and normal signal (GHK, LDRsim) are consistent
837 LDRCorr = (LDRsim / Eta * (GT + HT) - (GR + HR)) / ((GR - HR) - LDRsim * K / Etax * (GT - HT)) 849 LDRCorr = (LDRsim / Eta * (GT + HT) - (GR + HR)) / ((GR - HR) - LDRsim * K / Etax * (GT - HT))
838 850 #LDRCorr = LDRsimx # for test only
839 TTa = TiT * TaT # *ATP1 851 TTa = TiT * TaT # *ATP1
840 TRa = TiR * TaR # *ARP1 852 TRa = TiR * TaR # *ARP1
841 853
842 F11sim = 1 / (TiO * TiE) * ( 854 F11sim = 1 / (TiO * TiE) * (
843 (HR * Etax / K * It / TTa - HT * Ir / TRa) / (HR * GT - HT * GR)) # IL = 1, Etat = Etar = 1 ; AMT Eq.64; what is Etax/K? => see about 20 lines above: = Eta 855 (HR * Etax / K * It / TTa - HT * Ir / TRa) / (HR * GT - HT * GR)) # IL = 1, Etat = Etar = 1 ; AMT Eq.64; what is Etax/K? => see about 20 lines above: = Eta
930 print("{0:8},{1:8},{2:8},{3:8},{4:9},{5:8},{6:9}".format(" GR", " GT", " HR", " HT", " K(0.004)", " K(0.2)", 942 print("{0:8},{1:8},{2:8},{3:8},{4:9},{5:8},{6:9}".format(" GR", " GT", " HR", " HT", " K(0.004)", " K(0.2)",
931 " K(0.45)")) 943 " K(0.45)"))
932 print("{0:8.5f},{1:8.5f},{2:8.5f},{3:8.5f},{4:9.5f},{5:9.5f},{6:9.5f}".format(GR0, GT0, HR0, HT0, K0List[0], 944 print("{0:8.5f},{1:8.5f},{2:8.5f},{3:8.5f},{4:9.5f},{5:9.5f},{6:9.5f}".format(GR0, GT0, HR0, HT0, K0List[0],
933 K0List[1], K0List[2])) 945 K0List[1], K0List[2]))
934 print('========================================================================') 946 print('========================================================================')
935 print("{0:9},{1:9},{2:9}".format(" LDRtrue", " LDRsimx", " LDRCorr")) 947 print("{0:10},{1:10},{2:10},{3:10}".format(" LDRtrue", " LDRsimx", " 1/LDRsimx", " LDRCorr"))
936 948
937 #LDRtrueList = 0.004, 0.02, 0.2, 0.45 949 #LDRtrueList = 0.004, 0.02, 0.2, 0.45
938 aF11sim0 = np.zeros(5) 950 aF11sim0 = np.zeros(5)
939 LDRrange = np.zeros(5) 951 LDRrange = np.zeros(5)
940 LDRrange = 0.004, 0.02, 0.1, 0.3, 0.45 952 LDRrange = 0.004, 0.02, 0.1, 0.3, 0.45
949 DiO0, RotC0, RetC0, 961 DiO0, RotC0, RetC0,
950 DiC0, TP0, TS0, RP0, 962 DiC0, TP0, TS0, RP0,
951 RS0, ERaT0, RotaT0, 963 RS0, ERaT0, RotaT0,
952 RetT0, ERaR0, RotaR0, 964 RetT0, ERaR0, RotaR0,
953 RetR0, LDRCal0) 965 RetR0, LDRCal0)
954 print("{0:9.5f},{1:9.5f},{2:9.5f}".format(LDRtrue, LDRsimx, LDRCorr)) 966 print("{0:10.5f},{1:10.5f},{2:10.5f},{3:10.5f}".format(LDRtrue, LDRsimx, 1/LDRsimx, LDRCorr))
955 aF11sim0[i] = F11sim0 967 aF11sim0[i] = F11sim0
956 # the assumed true aF11sim0 results will be used below to calc the deviation from the real signals 968 # the assumed true aF11sim0 results will be used below to calc the deviation from the real signals
969 print("Note: LDRsimx = LDR of the nominal system directly from measured signals without GHK-corrections")
957 970
958 file = open('output_files\output_' + LID + '.dat', 'r') 971 file = open('output_files\output_' + LID + '.dat', 'r')
959 print(file.read()) 972 print(file.read())
960 file.close() 973 file.close()
961 974
1696 # Text1 = " x-axis: IT(LDRtrue) / IT(LDRtrue = 0.004) - 1" 1709 # Text1 = " x-axis: IT(LDRtrue) / IT(LDRtrue = 0.004) - 1"
1697 # F11corr = It/(TaT*TiT*TiO*TiE) #/(TaT*TiT*TiO*TiE*(GT0+atrue*HT0)) 1710 # F11corr = It/(TaT*TiT*TiO*TiE) #/(TaT*TiT*TiO*TiE*(GT0+atrue*HT0))
1698 # !!! see below line 1673ff 1711 # !!! see below line 1673ff
1699 1712
1700 aF11corr[iLDR, iN] = F11corr 1713 aF11corr[iLDR, iN] = F11corr
1701 aA[iLDR, iN] = LDRCorr 1714 aA[iLDR, iN] = LDRCorr # LDRCorr # LDRsim # for test only
1702 1715
1703 aX[0, iN] = GR 1716 aX[0, iN] = GR
1704 aX[1, iN] = GT 1717 aX[1, iN] = GT
1705 aX[2, iN] = HR 1718 aX[2, iN] = HR
1706 aX[3, iN] = HT 1719 aX[3, iN] = HT

mercurial