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) Spectrum[source]¶
Convert
(w, I)into aSpectrumobject 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
Nonecond_units (dict) ā (optional) calculation conditions units. Default
Nonepopulations (dict) ā populations to be stored in Spectrum. Default
Nonename (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='count', conditions={}, cond_units=None, name=None) Spectrum[source]¶
Convert
(w, I)into aSpectrumobject 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
'count', āmW/cm2/sr/nmā, etcā¦). Default'count'(i.e., non calibrated 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 # transpose is often useful, depending on your data. 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) Spectrum[source]¶
Convert
(w, I)into aSpectrumobject 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
""(adimensioned)
- 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'