radis.spectrum.models module

Summary

Models built around the Spectrum class

Routine Listing

See also

To, and, see

-

func:Radiance

-

func:Radiance_noslit

-

func:Transmittance

-

func:Transmittance_noslit


calculated_spectrum(w, I, wunit='nm', Iunit='mW/cm2/sr/nm', conditions=None, cond_units=None, populations=None, name=None) radis.spectrum.spectrum.Spectrum[source]

Convert (w, I) into a Spectrum object that has unit conversion, plotting and slit convolution capabilities.

Parameters
  • w (np.array) – wavelength, or wavenumber

  • I (np.array) – intensity (no slit)

  • wunit ('nm', 'cm-1', 'nm_vac') – wavespace unit: wavelength in air ('nm'), wavenumber ('cm-1'), or wavelength in vacuum ('nm_vac'). Default 'nm'.

  • Iunit (str) – intensity unit (can be ‘counts’, ‘mW/cm2/sr/nm’, etc…). Default ‘mW/cm2/sr/nm’ (note that non-convoluted Specair spectra are in ‘mW/cm2/sr/µm’)

Other Parameters
  • conditions (dict) – (optional) calculation conditions to be stored with Spectrum. Default None

  • cond_units (dict) – (optional) calculation conditions units. Default None

  • populations (dict) – populations to be stored in Spectrum. Default None

  • name (str) – (optional) give a name

Examples

# w, I are numpy arrays for wavelength and radiance
from radis import calculated_spectrum
s = calculated_spectrum(w, I, wunit='nm', Iunit='W/cm2/sr/nm')     # creates 'radiance_noslit'
experimental_spectrum(w, I, wunit='nm', Iunit='counts', conditions={}, cond_units=None, name=None) radis.spectrum.spectrum.Spectrum[source]

Convert (w, I) into a Spectrum object that has unit conversion and plotting capabilities. Convolution is not available as the spectrum is assumed to have be measured experimentally (hence it is already convolved with the slit function)

Parameters
  • w (np.array) – wavelength, or wavenumber

  • I (np.array) – intensity

  • wunit ('nm', 'cm-1', 'nm_vac') – wavespace unit: wavelength in air ('nm'), wavenumber ('cm-1'), or wavelength in vacuum ('nm_vac'). Default 'nm'.

  • Iunit (str) – intensity unit (can be ‘counts’, ‘mW/cm2/sr/nm’, etc…). Default ‘counts’ (default Winspec output)

Other Parameters
  • conditions (dict) – (optional) calculation conditions to be stored with Spectrum

  • cond_units (dict) – (optional) calculation conditions units

  • name (str) – (optional) give a name

Examples

Load and plot an experimental spectrum:

from numpy import loadtxt
from radis import experimental_spectrum
w, I = loadtxt('my_file.txt').T    # assuming 2 columns
s = experimental_spectrum(w, I, Iunit='mW/cm2/sr/nm')             # creates 'radiance'
s.plot()
transmittance_spectrum(w, T, wunit='nm', Tunit='', conditions=None, cond_units=None, name=None) radis.spectrum.spectrum.Spectrum[source]

Convert (w, I) into a Spectrum object that has unit conversion, plotting and slit convolution capabilities.

Parameters
  • w (np.array) – wavelength, or wavenumber

  • T (np.array) – transmittance (no slit)

  • wunit ('nm', 'cm-1', 'nm_vac') – wavespace unit: wavelength in air ('nm'), wavenumber ('cm-1'), or wavelength in vacuum ('nm_vac'). Default 'nm'.

  • Iunit (str) – intensity unit. Default "" (adimensionned)

Other Parameters
  • conditions (dict) – (optional) calculation conditions to be stored with Spectrum

  • cond_units (dict) – (optional) calculation conditions units

  • name (str) – (optional) give a name

Examples

# w, T are numpy arrays for wavelength and transmittance
from radis import transmittance_spectrum
s2 = transmittance_spectrum(w, T, wunit='nm')                       # creates 'transmittance_noslit'