# Thermal simulation : Impact of Cloud optical depth on Transmittance

  • Sylvie Dagoret-Campagne

  • affliliation : IJCLAB/IN2P3/CNRS

  • creation date : 24 January 2020

  • last update : November 7th 2023


[1]:
%load_ext autoreload
%autoreload 2
[2]:
import matplotlib.pyplot as plt
%matplotlib inline
import sys
import os
import numpy as np
[3]:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
[4]:
matplotlib.rcParams.update({'font.size': 15, 'lines.linewidth': 2, 'lines.markersize': 15})
matplotlib.rcParams["axes.labelsize"]="small"
matplotlib.rcParams["axes.linewidth"]=2.0
matplotlib.rcParams["xtick.major.size"]=8
matplotlib.rcParams["ytick.major.size"]=8
matplotlib.rcParams["ytick.minor.size"]=5
matplotlib.rcParams["xtick.labelsize"]="large"
matplotlib.rcParams["ytick.labelsize"]="large"
matplotlib.rcParams["figure.figsize"]=(12,6)
matplotlib.rcParams['axes.titlesize'] = 15
matplotlib.rcParams['axes.titleweight'] = 'bold'
#matplotlib.rcParams['axes.facecolor'] = 'blue'
matplotlib.rcParams['xtick.direction'] = 'out'
matplotlib.rcParams['ytick.direction'] = 'out'
matplotlib.rcParams['lines.markeredgewidth'] = 0.3 # the line width around the marker symbol
matplotlib.rcParams['lines.markersize'] = 10  # markersize, in points
matplotlib.rcParams['grid.alpha'] = 1. # transparency, between 0.0 and 1.0
matplotlib.rcParams['grid.linestyle'] = '-' # simple line
matplotlib.rcParams['grid.linewidth'] = 0.4 # in points
[5]:
from scipy.interpolate import interp1d
[6]:
import time
from datetime import datetime,date
import dateutil.parser
[7]:
today = date.today()
string_date=today.strftime("%Y-%m-%d")
[8]:
from libradtranpy import libsimulateThermal
from libradtranpy import libsimulateVisible
[9]:
os.getenv('LIBRADTRANDIR')
[9]:
'/Users/dagoret/MacOSX/External/libRadtran'
[10]:
am=1.
pressure = 0.
pwv=4.0
aer=0
ozone=300.
[11]:
cloudext=np.linspace(0.0,0.2,10)
[12]:
NBOBS=len(cloudext)
[13]:
jet = plt.get_cmap('jet')
cNorm = colors.Normalize(vmin=0, vmax=NBOBS)
scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=jet)
all_colors = scalarMap.to_rgba(np.arange( NBOBS), alpha=1)
[14]:
#libsimulateThermal.ProcessSimulation?
[15]:
all_transm = []
for index in np.arange(NBOBS):

    path,thefile=libsimulateThermal.ProcessSimulation(am,pwv,ozone,pressure,
                                                      prof_str='us',proc_str='sa',cloudext=cloudext[index],thermal_output='transmittance')

    data = np.loadtxt(os.path.join(path,thefile))
    wl = data[:,0]
    atm = data[:,1]
    all_transm.append(1.-atm)
[16]:
wl1=wl
[17]:
for index,cldod in enumerate(cloudext):
    label = f"cloud od = {cldod:.2f}"
    plt.plot(wl1,all_transm[index],'-',color=all_colors[index],label=label)
plt.xlim(0,25000)
plt.grid()
plt.title("Transmittance for cloud optical depth from 0 to 0.2")
plt.xlabel("$\\lambda$ (nm)")
plt.ylabel("transmittance")
plt.legend(loc="lower right")
figname=string_date+"_multitransmittanceforcld.png"

plt.savefig(figname)
../../../_images/notebooks_libradtranpy_thermal_SimuRT_thermal_CLD_Transmittance_17_0.png
[18]:
all_trans = []
for index in np.arange(NBOBS):

    path,thefile=libsimulateVisible.ProcessSimulation(am,pwv,ozone,pressure,
                                                      prof_str='us',proc_str='sa',cloudext=cloudext[index])
    data = np.loadtxt(os.path.join(path,thefile))
    wl = data[:,0]
    atm = data[:,1]
    all_trans.append(atm)
[19]:
wl2=wl
[20]:
for index,cldod in enumerate(cloudext):
    label = f"cloud od = {cldod:.2f}"
    plt.semilogy(wl2,all_trans[index],'-',color=all_colors[index],label=label)
plt.xlim(300,1200)
plt.grid()
plt.title("Atmospheric transmission for cloud optical depth from 0 to 0.2")
plt.xlabel("$\\lambda$ (nm)")
plt.ylabel("transmission")
plt.ylim(0.5,1)
plt.legend(loc="lower left")
figname=string_date+"_multivisibletransmissionforcld.png"
plt.savefig(figname)
../../../_images/notebooks_libradtranpy_thermal_SimuRT_thermal_CLD_Transmittance_20_0.png