# Gnuplot script to show solar spectral irradiance at 1 AU,
# in W/(m2.nanometer).
# The Planck spectrum of a "blacbody Sun" giving the same total irradiance
# is shown too.
# Three solar spectra are:
# above-atmosphere, tilted AM 1.5 total, and direct AM 1.5
# taken from
# http://rredc.nrel.gov/solar/spectra/am1.5/
# Titles are in English. Script by Jan Hollan, 2013, pdf non-colour version
set encoding utf8
#set term svg dashed enhanced size 800,600
set term pdf monochrome dashed enhanced
set out "solar_eng_grey.pdf"
set grid
Planck(x,t) = \
1E-9*3.741E-16/(( exp(5*log((x*1E-6))) )*(exp(1.439E-2/(x*t*1E-6))-1))
aur = (149.6/0.6963)**2
set title font ",7" \
"Solar spectra at 1 AU, log. scale λ; \
Planck function for 5778 K"
set ylabel \
"( λ / nm) × \
density of spectral radiant flux\n \
/ (W.m^{/*0.7 -2}nm^{/*0.7 -1})"
set xlabel "ln (λ / nm)"
set xtics 1 nomirror
set x2label "λ / nm"
set x2tics font ",4" \
("Ca \n 395 " log(395), \
"Hγ\n 434" log(434),\
"Hβ\n 486" log(486), \
"Na\n 589" log(589), \
"Hα\n 656" log(656.28), \
"O_2\n 759" log(759), \
"1000" log(1000), "2000" log(2000) , "4000" log(4000))
# "b\n 517" log(517), \
# "Fe,527" log(527), \
f(x)=exp(x)*Planck(exp(x)/1000,5778) / aur
#set style line 2 lt rgb "grey" solid
#set style line 3 lt rgb "grey" solid lw 0.5
plot [5.6:8.3] \
"a.txt" using (log($1)):($2*$1) \
with lines lc rgb "grey70" lw 3 title 'above atmosphere',\
"a.txt" using (log($1)):($3*$1) with lines lt 1 lc rgb "grey40" lw 1 \
title 'AM 1.5 incl. diffuse radiation' ,\
"a.txt" using (log($1)):($4*$1) with lines lt 1 lw 0.2 \
title 'through AM 1.5', \
f(x) title 'blackbody 5778 K' with lines lt 2 lw 2
quit