radis.spectrum.utils module

Functions and constants used in Spectrum object


CONVOLUTED_QUANTITIES = ['radiance', 'transmittance', 'emissivity'][source]

name of spectral quantities after convolution with slit function

Type

list

INFORMATIVE_PARAMS = ['db_use_cached', 'lvl_use_cached', 'chunksize', 'calculation_time', 'total_lines', 'lines_calculated', 'lines_cutoff', 'lines_in_continuum', 'Nprocs', 'warning_broadening_threshold', 'warning_linestrength_cutoff', 'load_energies', 'export_lines', 'export_populations'][source]

Informative parameters. Parameters that should be saved in the Spectrum objects, but ignored when comparing two spectra. Should be written here only these parameters that cannot affect the physical result. In particular, all parameters relative to performance should be added here.

Notes

units for these parameters are stored in Spectrum.cond_units and are defined by the generating class (ex: SpectrumFactory)

Type

list

NON_CONVOLUTED_QUANTITIES = ['radiance_noslit', 'transmittance_noslit', 'emisscoeff', 'emisscoeff_continuum', 'absorbance', 'abscoeff', 'abscoeff_continuum', 'emissivity_noslit'][source]

name of spectral quantities not convolved with slit function

See the description of spectral quantities

Type

list

PHYSICAL_PARAMS = ['molecule', 'wavenum_max', 'wavenum_min', 'mole_fraction', 'isotope', 'state', 'path_length', 'medium', 'self_absorption', 'slit_function_base', 'pressure_mbar', 'wavelength_min', 'wavelength_max', 'Telec', 'Tvib', 'Trot', 'Tgas', 'vib_distribution', 'rot_distribution', 'overpopulation', 'thermal_equilibrium'][source]

physical conditions under which the Spectrum was calculated/measured. When printing an object, these parameters are shown below “Physical Conditions” If a parameter is not in this list, it is either in “Computation Parameters” (non-physical parameters that can have an influence on the Spectrum, e.g, cutoffs and thresholds) or in “Informative Params” (descriptive parameters that have absolutely no impact on the spectrum, e.g, number of lines calculated or calculation time)

Type

list

SPECTRAL_QUANTITIES = ['radiance', 'transmittance', 'emissivity', 'radiance_noslit', 'transmittance_noslit', 'emisscoeff', 'emisscoeff_continuum', 'absorbance', 'abscoeff', 'abscoeff_continuum', 'emissivity_noslit'][source]

all spectral quantities defined in a Spectrum object.

See the description of spectral quantities

Type

list

WAVESPACE = ['nm', 'nm_vac', 'cm-1'][source]

wavespace: - 'nm': wavelength (in air) - 'nm_vac': wavelength (in vacuum) - 'cm-1': wavenumber

Type

list

cast_waveunit(unit, force_match=True)[source]

Standardize unit formats.

format_xlabel(wunit, plot_medium)[source]

Used by radis.spectrum.spectrum.Spectrum.plot() and radis.spectrum.compare.plot_diff()

Parameters
  • wunit ('default', 'nm', 'cm-1', 'nm_vac',) – wavelength air, wavenumber, or wavelength vacuum. If 'default', Spectrum get_waveunit() is used.

  • plot_medium (bool, 'vacuum_only') – if True and wunit are wavelengths, plot the propagation medium in the xaxis label ([air] or [vacuum]). If 'vacuum_only', plot only if wunit=='nm_vac'. Default 'vacuum_only' (prevents from inadvertently plotting spectra with different propagation medium on the same graph).

has_nan(s)[source]
Parameters

s (Spectrum) – radis Spectrum.

Returns

b – returns whether Spectrum has nan

Return type

bool

Note

print(s) will also show which spectral quantities have ````nan.

make_up(label)[source]

Cosmetic changes on label, before plot.

Parameters

label (str)

make_up_unit(Iunit, var)[source]

Additional cosmetic changes for units on label, before plot.

Parameters
  • Iunit (str) – input unit

  • var (str) – spectral variable. Ex: transmittance

print_conditions(conditions, units, phys_param_list=['molecule', 'wavenum_max', 'wavenum_min', 'mole_fraction', 'isotope', 'state', 'path_length', 'medium', 'self_absorption', 'slit_function_base', 'pressure_mbar', 'wavelength_min', 'wavelength_max', 'Telec', 'Tvib', 'Trot', 'Tgas', 'vib_distribution', 'rot_distribution', 'overpopulation', 'thermal_equilibrium'], info_param_list=['db_use_cached', 'lvl_use_cached', 'chunksize', 'calculation_time', 'total_lines', 'lines_calculated', 'lines_cutoff', 'lines_in_continuum', 'Nprocs', 'warning_broadening_threshold', 'warning_linestrength_cutoff', 'load_energies', 'export_lines', 'export_populations'])[source]

Print all Spectrum calculation parameters.

Parameters
  • phys_param_list (list) – These parameters are shown below “Physical Conditions” rather than “Computation Parameters. See PHYSICAL_PARAMS for more information.

  • info_param_list (list) – These parameters are shown below “Information” rather than “Computation Parameters. See INFORMATIVE_PARAMS for more information.

split_and_plot_by_parts(w, I, *args, **kwargs)[source]