Giter Site home page Giter Site logo

spectro101's Issues

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.