Calculate a large spectrum by partΒΆ

In may be faster to calculate a full-range spectrum on several partial spectral ranges, and combine them.

Uses the MergeSlabs() function for that.

Starting from 0.11, RADIS introduces a sparse waverange implementation that should make it possible to directly compute a full range spectrum. See the HITRAN full-range example

plot merged large spectrum
0.05s - Loaded database
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: HighTemperatureWarning: HITRAN is valid for low temperatures (typically < 700 K). For higher temperatures you may need HITEMP or CDSD. See the 'databank=' parameter
  warnings.warn(WarningType(message))
0.05s - Loaded database
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: HighTemperatureWarning: HITRAN is valid for low temperatures (typically < 700 K). For higher temperatures you may need HITEMP or CDSD. See the 'databank=' parameter
  warnings.warn(WarningType(message))
0.03s - Loaded database
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: HighTemperatureWarning: HITRAN is valid for low temperatures (typically < 700 K). For higher temperatures you may need HITEMP or CDSD. See the 'databank=' parameter
  warnings.warn(WarningType(message))
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: UnevenWaverangeWarning: When resampling the spectrum, the new waverange had unequal spacing.
  warnings.warn(WarningType(message))
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: UnevenWaverangeWarning: When resampling the spectrum, the new waverange had unequal spacing.
  warnings.warn(WarningType(message))
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/misc/warning.py:434: UnevenWaverangeWarning: When resampling the spectrum, the new waverange had unequal spacing.
  warnings.warn(WarningType(message))
OH-hitran-1000K-#2192 new quantities added: ['emisscoeff']
OH-hitran-1000K-#4640 new quantities added: ['emisscoeff']
OH-hitran-1000K-#3488 new quantities added: ['emisscoeff']
Spectrum Name:  OH-hitran-1000K-#2192//OH-hitran-1000K-#4640//OH-hitran-1000K-#3488
Spectral Quantities
----------------------------------------
  abscoeff      [cm-1]  (99,502 points)
  emisscoeff    [mW/cm3/sr/cm-1]        (99,502 points)
  transmittance_noslit  (99,502 points)
  emissivity_noslit     (99,502 points)
  absorbance    (99,502 points)
  radiance_noslit       [mW/cm2/sr/cm-1]        (99,502 points)
Physical Conditions
----------------------------------------
   Tgas                 1000 K
   isotope              N/A
   medium               air
   mole_fraction        0.1
   path_length          1 cm
   pressure             10 bar
   self_absorption      True
   species              {'OH'}
   state                X
   thermal_equilibrium  True
   wavenum_max          N/A cm-1
   wavenum_min          N/A cm-1
Computation Parameters
----------------------------------------
   NwG                  N/A
   NwL                  4
   Tref                 296 K
   add_at_used          numpy
   broadening_method    voigt_poly
   cutoff               1e-27 cm-1/(#.cm-2)
   dbformat             hitran
   dbpath               /home/docs/.radisdb/hitran/OH.h5
   default_output_unit  cm-1
   diluent              air
   diluents             {'air': 0.9}
   folding_thresh       1e-06
   include_neighbouring_lines  True
   isatom               False
   isneutral            None
   lbfunc               None
   memory_mapping_engine  auto
   neighbour_lines      0 cm-1
   optimization         simple
   parsum_mode          full summation
   pfsource             default
   potential_lowering   None
   pseudo_continuum_threshold  0
   radis_version        0.17
   sparse_ldm           True
   spectral_points      N/A
   truncation           50 cm-1
   waveunit             cm-1
   wstep                Unequal spacing, average <wstep>=0.10 cm-1
   zero_padding         N/A
Config parameters
----------------------------------------
   DEFAULT_DOWNLOAD_PATH  ~/.radisdb
   GRIDPOINTS_PER_LINEWIDTH_ERROR_THRESHOLD  1
   GRIDPOINTS_PER_LINEWIDTH_WARN_THRESHOLD  3
   SPARSE_WAVERANGE     auto
Information
----------------------------------------
   calculation_time     0.09899710399986361 s
   chunksize            None
   db_use_cached        True
   dxG                  0.1375350788016573
   dxL                  0.20180288881201608
   export_lines         False
   export_populations   None
   export_rovib_fraction  True
   levelsfmt            None
   lines_calculated     5,587
   lines_cutoff         21,804
   lines_in_continuum   0
   load_energies        False
   lvl_use_cached       True
   parfuncpath          None
   total_lines          27391
   warning_broadening_threshold  0.01
   warning_linestrength_cutoff  0.01
   wavenum_max_calc     N/A cm-1
   wavenum_min_calc     N/A cm-1
----------------------------------------

/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/develop/radis/phys/air.py:57: UserWarning: air_index_dispersion used below its lower limit of validity: 300 nm
  warnings.warn(

<matplotlib.lines.Line2D object at 0x79deef542ba0>

from radis import MergeSlabs, calc_spectrum

spectra = []
for wmin, wmax in [(50, 3000), (3000, 7000), (7000, 10000)]:

    spectra.append(
        calc_spectrum(
            wmin,
            wmax,
            Tgas=1000,
            pressure=10,  # bar
            molecule="OH",
            path_length=1,
            mole_fraction=0.1,
            wstep=0.1,
            databank="hitran",
            verbose=False,
        )
    )

s = MergeSlabs(*spectra, resample="full", out="transparent")
print(s)
s.plot("transmittance_noslit", wunit="nm")

Total running time of the script: (0 minutes 0.606 seconds)