Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
erwanp opened this issue Apr 5, 2022 · 0 comments

Comments

@erwanp
Copy link
Member

erwanp commented Apr 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant