====== Solar irradiance spectrum ====== //Task:// Compute the direct and the diffuse solar irradiance spectrum at the surface in the spectral range from 200 to 3500 nm. Plot the result together with the extraterrestrial solar spectrum and the estimate of solar irradiance using the Planck function. Which spectral features result from absorption in the Earth atmosphere? # specify libRadtran data path data_files_path /home/claudia/libRadtran/data # Location of atmospheric profile file. atmosphere_file us-standard mol_abs_param lowtran # Location of the extraterrestrial spectrum source solar kurudz_1.0nm.dat albedo 0.0 # Surface albedo sza 30.0 # Solar zenith angle rte_solver disort2 # Radiative transfer equation solver wavelength 200.0 3500.0 # Wavelength range [nm] zout sur # surface transmittance # use this option if you want transmittance instead of irradiance from pylab import * def planck(lam, T): c= 2.99792458e8 k= 1.380662e-23 h= 6.626180e-34 return 2*pi*h*c*c/(lam**5 * (exp(h*c/(lam*k*T))-1.)) # solar spectrum solar_spectrum=loadtxt('/home/claudia/libRadtran/data/solar_flux/kurudz_1.0nm.dat') d= 1.49e11 # sun-Earth distance r= 1.3914e9/2. # radius of the sun # irradiance from 300 to 500 nm sw_spectrum=loadtxt('irradiance.out') figure(1, figsize=(10,7)) plot(sw_spectrum[:,0], sw_spectrum[:,1]+sw_spectrum[:,2], label='irradiance') plot(solar_spectrum[:,0], solar_spectrum[:,1], 'k', label='TOA') plot(sw_spectrum[:,0], planck(sw_spectrum[:,0]*1e-9, 6000)*1e-6*(r/d)**2, label='Planck') xlim(200,2500) title('irradiance spectrum at the surface') xlabel('wavelength [nm]') ylabel('irradiance [mW/ (m^2 nm)]') legend(loc=1) savefig('solar_irrad.png') # transmittance from 300 to 500 nm trans_spectrum=loadtxt('transmittance.out') figure(2, figsize=(10,7)) plot(trans_spectrum[:,0], trans_spectrum[:,1]+trans_spectrum[:,2]) xlim(200,2500) title('transmittance spectrum at the surface') xlabel('wavelength [nm]') ylabel('transmittance') savefig('transmittance.png') [{{ :teaching:radiative_transfer:solar_irrad.png?600 |Solar irradiance spectrum at the surface. }}] [{{ :teaching:radiative_transfer:transmittance.png?600 |Transmittance spectrum. }}]