# Generate absorption profiles only wrt airmass at LSST
Sylvie Dagoret-Campagne
affliliation : IJCLAB/IN2P3/CNRS
creation date : 24 January 2020
update : Feb 20 2024 : ProcessSimulation returns wl and atm
Last verification : August 27th 2024
[ ]:
%load_ext autoreload
%autoreload 2
[ ]:
import matplotlib.pyplot as plt
%matplotlib inline
import sys
import os
import numpy as np
[ ]:
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cmx
[ ]:
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
[ ]:
from libradtranpy import libsimulateVisible
[ ]:
os.getenv('LIBRADTRANDIR')
[ ]:
import sys
sys.path
Choose the parameters of the simulation
[ ]:
AMMIN=1
AMMAX=2.5
NAM = 16
am=np.linspace(AMMIN,AMMAX,NAM)
pressure = 0. # use default value
pwv=4 # turn on or of the pwv
aer=0
ozone=0. # turn on or of the ozone
cloudext=0
[ ]:
NBOBS=len(am)
[ ]:
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)
Simulation
[ ]:
all_trans = []
for index in np.arange(NBOBS):
wl,atm=libsimulateVisible.ProcessSimulation(am[index],pwv,ozone,pressure,aer_num = aer,
prof_str='us',proc_str='ab',cloudext=cloudext)
all_trans.append(atm)
Plot
[ ]:
for index in np.arange(NBOBS):
plt.semilogy(wl,all_trans[index],'-',color=all_colors[index])
plt.xlim(650,1000)
plt.grid()
plt.title(f"Absorption atmospheric transmission for airmass in {AMMIN}-{AMMAX} range")
plt.xlabel("$\\lambda$ (nm)")
plt.ylabel("transmission")
plt.ylim(0.1,1)
figname="multiabstransmissionvsairmass_log.png"
plt.savefig(figname)
[ ]:
for index in np.arange(NBOBS):
plt.plot(wl,all_trans[index],'-',color=all_colors[index])
plt.xlim(300,1200)
plt.grid()
plt.title(f"Absorption atmospheric transmission for airmass in {AMMIN}-{AMMAX} range")
plt.xlabel("$\\lambda$ (nm)")
plt.ylabel("transmission")
plt.ylim(0.,1)
#plt.xlim(300,700)
figname="multiabstransmissionvsairmass_lin.png"
plt.savefig(figname)
[ ]: