Skip to content

TODO : add Fun Fact #1 : The sun would not be visible if the 4.2 µm CO2 lineshape was truely lorentzian #3

@erwanp

Description

@erwanp

Add a notebook based on this (working) Python example :

"""

Fun Facts About Spectroscopy
----------------------------

# The sun would not be visible if the 4.2 µm CO2 lineshape was truely lorentzian
"""


from radis import calc_spectrum
import matplotlib.pyplot as plt
import astropy.units as u

s = calc_spectrum(wavelength_min=0.3*u.um, wavelength_max=6*u.um,
                  molecule='CO2',
                  isotope='1,2,3',
                  pressure=1.01325,   # bar
                  truncation=None, 
                  Tgas=300,           # K
                  mole_fraction=400e-6,
                  cutoff=0,
                  databank='hitran',  # or use 'hitemp'
                  broadening_method="fft"
                  )

# note : the calculation is quite long (~190s on my laptop) because the FFT
# method used is not optimized for very large ranges

#%% Plot
s.plot('abscoeff', wunit='nm', yscale='log')
plt.axvspan(300, 700, alpha=0.3) # visible spectrum

# we get an absorption coefficient of about ~0.5 cm-1 in the visible range

# %% 
# which means that the sky would be >99% more opaque for a layer of only ~ 10 cm 
# (exp(-5) = 0.006 )

s.rescale_path_length(10).plot('transmittance_noslit', wunit='nm')
plt.axvspan(300, 700, alpha=0.3) # visible spectrum
plt.ylim((0, 1.1))
# plt.ylim((0, 1.1))

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions