Example of using RADIS from MatlabΒΆ
All methods of RADIS can be accessed using py.radis followed by the method to be accessed
In the lines below, we emulate Matlab syntax to generate the example on this online documentation, so that lines be copied directly into Matlab.
See the real Matlab file : https://github.com/radis/radis/blob/develop/examples/calc_matlab.m See https://github.com/radis/radis/pull/547 for more details and screenshots of Radis running in Matlab directly
from radis.test.utils import EmulateMatlab # this line is not needed in Matlab
py = EmulateMatlab() # this line is not needed in Matlab
All lines below can be copied in Matlab directly :
s = py.radis.calc_spectrum(
1900,
2300,
molecule="CO",
isotope="1,2,3",
pressure=1.01325,
Tgas=700,
mole_fraction=0.1,
path_length=1,
databank="hitran",
)
s.apply_slit(0.5, "nm")
--------------------------------------------------------------------------------
CO - HITRAN - Downloading database
--------------------------------------------------------------------------------
Download:
- All files already downloaded.
Caching to HDF5/H5 format:
- All files already cached.
0.02s - Loaded database
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
Tgas 700 K
isotope 1,2,3
medium air
mole_fraction 0.1
path_length 1 cm
pressure 1.01325 bar
self_absorption True
species CO
state X
wavenum_max 2300.0000 cm-1
wavenum_min 1900.0000 cm-1
Computation Parameters
----------------------------------------
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/CO.h5
diluent air
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
sparse_ldm True
truncation 50 cm-1
waveunit cm-1
wstep 0.01 cm-1
zero_padding 40002
----------------------------------------
0.03s - Spectrum calculated
<radis.spectrum.spectrum.Spectrum object at 0x79deeb237a30>
Total running time of the script: (0 minutes 0.075 seconds)