lidar_correction_ghk.py

changeset 11
453b23dd7f94
parent 10
a69e0c8ca55c
child 13
f08818615e3a
--- a/lidar_correction_ghk.py	Mon Nov 14 16:31:32 2016 +0100
+++ b/lidar_correction_ghk.py	Mon Nov 14 23:39:33 2016 +0100
@@ -17,21 +17,27 @@
 
 Equation reference: http://www.atmos-meas-tech-discuss.net/amt-2015-338/amt-2015-338.pdf
 With equations code from Appendix C
-Python 3.4.2 ,,
+Python 3.4.2
 """
 #!/usr/bin/env python3
+
+# Comment:  The code works with Python 2.7  with the help of following line, which enables Python2 to correctly interpret the Python 3 print statements.
 from __future__ import print_function
 #import math
 import numpy as np
 import sys
 import os
 
-#import seaborn as sns
+# Comment: the seaborn library makes nicer plots, but the code works also without it.
+try:
+    import seaborn as sns
+    sns_loaded = True
+except ImportError:
+    sns_loaded = False
+
 import matplotlib.pyplot as plt
 from time import clock
 
-
-
 #from matplotlib.backends.backend_pdf import PdfPages
 #pdffile = '{}.pdf'.format('path')
 #pp = PdfPages(pdffile)
@@ -162,6 +168,7 @@
 
 # --- Read actual lidar system parameters from ./optic_input.py  (must be in the same directory)
 
+InputFile = 'optic_input_example_lidar.py'
 #InputFile = 'optic_input_ver6e_POLIS_355.py'
 #InputFile = 'optic_input_ver6e_POLIS_355_JA.py'
 #InputFile = 'optic_input_ver6c_POLIS_532.py'
@@ -178,7 +185,7 @@
 #InputFile = 'optic_input_ver8c_PollyXT_RALPH_4.py'
 #InputFile = 'optic_input_ver8c_PollyXT_RALPH_5.py'
 #InputFile = 'optic_input_ver8c_PollyXT_RALPH_6.py'
-InputFile = 'optic_input_ver8c_PollyXT_RALPH_7.py'
+#InputFile = 'optic_input_ver8c_PollyXT_RALPH_7.py'
 #InputFile = 'optic_input_ver8a_MOHP_DPL_355.py'
 #InputFile = 'optic_input_ver9_MOHP_DPL_355.py'
 #InputFile = 'optic_input_ver6e_RALI.py'
@@ -1555,7 +1562,7 @@
                 LDRCorr = (LDRsim*K0/Etax*(GT0+HT0)-(GR0+HR0))/((GR0-HR0)-LDRsim*K0/Etax*(GT0-HT0))
 
                 # -- F11corr from It and Ir and calibration EtaX
-                Text1 = "F11corr from It and Ir with calibration EtaX: x-axis: F11corr(LDRtrue) / F11corr(LDRtrue = 0.004) - 1"
+                Text1 = "!!! EXPERIMENTAL !!!  F11corr from It and Ir with calibration EtaX: x-axis: F11corr(LDRtrue) / F11corr(LDRtrue = 0.004) - 1"
                 F11corr = 1/(TiO*TiE)*((HR0*Etax/K0*It/TTa-HT0*Ir/TRa)/(HR0*GT0-HT0*GR0))    # IL = 1  Eq.(64)
 
                 #Text1 = "F11corr from It and Ir without corrections but with calibration EtaX: x-axis: F11corr(LDRtrue) devided by F11corr(LDRtrue = 0.004)"
@@ -1603,8 +1610,9 @@
 print("\r done in      ", "{0:5.0f}".format(btime-atime), "sec") #, end="\r")
 
 # --- Plot -----------------------------------------------------------------
-#sns.set_style("whitegrid")
-#sns.set_palette("bright", 6)
+if (sns_loaded):
+    sns.set_style("whitegrid")
+    sns.set_palette("bright", 6)
 
 '''
 fig2 = plt.figure()
@@ -1680,6 +1688,7 @@
 
 print()
 #print("IT(LDRtrue) devided by IT(LDRtrue = 0.004)")
+print(" ############################################################################## ")
 print(Text1)
 print()
 

mercurial