Find weak lines, add them in pseudo-continuum (note that pseudo-
continuum by RADIS definition is actually more a sum of low-resolution
lines)
Parameters:
noneq (bool) – if True, also returns the emisscoeff pseudo continuum (for noneq
cases). Default False
Returns:
k_continuum (numpy array (1/(#.cm-2))) – abscoeff semi-continuum on wavenumber space
j_continuum (numpy array) – only returned if noneq=True : emisscoeff semi-continuum on
wavenumber space
Also – self.df1 is updated, lines are removed
local variables self._Nlines_in_continuum and self._Nlines_calculated
are created
Notes
continuum can be exported in Spectrum is using the self.export_continuum
boolean. This is not available as a User input but can be edited manually
in the Factory.
The Weak line characterization [1]_ is only based on abscoeff. For strong
nonequilibrium cases there may be lines considered as weak in terms
of absorption but not weak in emission, or the other way around. It should
be negligible, though, so a dual conditioning (looking at both abscoeff
and emisscoeff) was not implemented.
See radis.lbl.broadening._find_weak_lines() if you want to change that
initial line database after loading.
If for any reason, you want to manipulate the line database manually (for instance, keeping only lines emitting
by a particular level), you need to access the df0 attribute of
SpectrumFactory.
Warning
never overwrite the df0 attribute, else some metadata may be lost in the process.
Only use inplace operations. If reducing the number of lines, add
a df0.reset_index()
For instance:
fromradisimportSpectrumFactorysf=SpectrumFactory(wavenum_min=2150.4,wavenum_max=2151.4,pressure=1,isotope=1)sf.load_databank('HITRAN-CO-TEST')sf.df0.drop(sf.df0[sf.df0.vu!=1].index,inplace=True)# keep lines emitted by v'=1 onlysf.eq_spectrum(Tgas=3000,name='vu=1').plot()
df0 contains the lines as they are loaded from the database.
df1 is generated during the spectrum calculation, after the
line database reduction steps, population calculation, and scaling of intensity and broadening parameters
with the calculated conditions.
also in NEQAIR 96 manual Eqn. (D2) Note that formula is given in wavelength (nm) [doesnt
change anything] and uses full width half maximum (FWHM) of Gaussian and
Lorentzian profiles.
Calculates collisional broadening HWHM over all lines by scaling
tabulated HWHM for new pressure and mole fractions conditions [1]_
Note that collisional broadening is computed with a different coefficient
for air broadening and self broadening. In the case of non-air mixtures,
then the results should be used with caution, or better, the air broadening
coefficient be replaced with the gas broadening coefficient
Parameters:
airbrd (array like [length N]) – half-width half max coefficient (HWHM ) for collisional broadening with air
selbrd (array like [length N]) – half-width half max coefficient (HWHM ) for resonant (self) broadening with air
Tdpair (array like [length N]) – temperature dependance coefficient for collisional broadening with air
Tdpsel (array like, optional [length N]) – temperature dependance coefficient for resonant (self) broadening.
If None, use Tdpair.
pressure_atm (float [atm]) – pressure in atmosphere (warning, not bar!)
mole_fraction (float [0-1]) – mole fraction
Tgas (float [K]) – (translational) gas temperature
Tref (float [K]) – reference temperature at which tabulated HWHM pressure
broadening coefficients were tabulated
diluent (dictionary) – contains diluent and their mole fraction
diluent_broadening_coeff (dictionary) – contains all non air diluents broadening coefficients
Returns:
Depends on the engine used . Vaex Expression are memory efficient
Lorentzian half-width at half-maximum (HWHM) for each line profile
Return type:
pandas Series or Vaex Expression [shape N]
References
For self (resonant) and air broadening :
\[\gamma_{lb}={\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{air}} \gamma_{air} P \left(1-x\right)+{\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{self}} \gamma_{self} P x\]
With \(n_{air}, n_{self}\) the temperature dependance coefficients
Tdpair,Tdpsel ; \(\gamma_{air}, \gamma_{self}\) the air and resonant
HWHM broadening tabulated at \(T_{ref}\), \(x\) the mole_fraction.
For multiple diluents with respective mole fractions `x_{air}`, `x_i` , `x_j`, etc. :
\[\gamma_{lb}={\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{air}} \gamma_{air} P x_{air} +{\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{self}} \gamma_{self} P x + {\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{i}} \gamma_{i} P x_{i} + {\left(\frac{T_{ref}}{T_{gas}}\right)}^{n_{i}} \gamma_{j} P x_{j} + ...\]
Quickly sums all lines on wavespace grid as rectangles of HWHM
corresponding to hwhm_voigt and a spectral absorption coefficient value so
that linestrength is conserved.
i.e. profiles are approximated as a rectangle of width \(\alpha \cdot FWHM_{Voigt}\),
and with the same linestrength.
Parameters:
df (pandas Dataframe) – Contains shiftwav (wavenumbers) and S (linestrengths) and hwhm_voigt
(Voigt HWHM) size N (number of lines)
wavenumber (np.array) – spectral grid. Size W. Expected to be regular
wstep (float (cm-1)) – wavenumber step
Returns:
k_rough_spectrum (np.array) – spectral absorption coefficient for the waverange wavenumber,
calculated by assuming a rectangular profile for each line. Size W
S_density_on_grid – average spectral linestrength intensity of each line (abscoeff ~k), assuming
rectangular profile. size N
line2grid_projection – closest index of the center of each line in df on the spectral grid
wavenumber. Size N
Quickly sums all lines on wavespace grid as rectangles of HWHM
corresponding to hwhm_voigt and a spectral absorption coefficient value so
that linestrength is conserved.
i.e. profiles are approximated as a rectangle of width \(\alpha \cdot FWHM_{Voigt}\),
and with the same linestrength.
Parameters:
df (pandas Dataframe) – Contains shiftwav (wavenumbers) and S (linestrengths) and hwhm_voigt
(Voigt HWHM) size N (number of lines)
wavenumber (np.array) – spectral grid. Size W. Expected to be regular
wstep (float (cm-1)) – wavenumber step
quantity (‘S’ or ‘Ei’) – use ‘S’ for Linestrength, ‘Ei’ for emission integral. Default ‘S’
Returns:
k_rough_spectrum (np.array) – spectral absorption coefficient for the waverange wavenumber,
calculated by assuming a rectangular profile for each line. Size W
j_rough_spectrum (np.array) – spectral emission coefficient for the waverange wavenumber,
calculated by assuming a rectangular profile for each line. Size W
S_density_on_grid – average spectral linestrength intensity of each line (abscoeff ~k), assuming
rectangular profile. size N
Ei_density_on_grid – average spectral emission intensity of each line (emisscoeff ~j), assuming
rectangular profile. size N
line2grid_projection – closest index of the center of each line in df on the spectral grid
wavenumber. Size N
Notes
Similar to project_lines_on_grid() except
that we also calculate the approximate emission intensity (noneq > it cannot
be recomputed from the linestrength).
Calculates Voigt lineshape using the approximation of the Voigt profile
of [NEQAIR-1996], [Whiting-1968] that maintains a good accuracy in the far wings.
Exact for a pure Gaussian and pure Lorentzian.
Parameters:
w_centered (2D array [one per line: shape W x N]) – waverange (nm / cm-1) (centered on 0)
hwhm_lorentz (array (cm-1) [length N]) – half-width half maximum coefficient (HWHM) for Lorentzian broadening
hwhm_voigt (array (cm-1) [length N]) – half-width half maximum coefficient (HWHM) for Voigt broadening,
calculated by voigt_broadening_HWHM()
Other Parameters:
jit (boolean) – if True, use just in time compiler. Usually faster when > 10k lines.
Default True.