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")
/home/docs/checkouts/readthedocs.org/user_builds/radis/checkouts/latest/radis/db/molparam.py:252: FutureWarning:
The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use ``sep='\s+'`` instead
Calculating Equilibrium Spectrum
Physical Conditions
----------------------------------------
Tgas 700 K
Trot 700 K
Tvib 700 K
isotope 1,2,3
mole_fraction 0.1
molecule CO
overpopulation None
path_length 1 cm
pressure 1.01325 bar
rot_distribution boltzmann
self_absorption True
state X
vib_distribution boltzmann
wavenum_max 2300.0000 cm-1
wavenum_min 1900.0000 cm-1
Computation Parameters
----------------------------------------
Tref 296 K
add_at_used numpy
broadening_method voigt
cutoff 1e-27 cm-1/(#.cm-2)
dbformat hitran
dbpath /home/docs/.radisdb/hitran/CO.hdf5
folding_thresh 1e-06
include_neighbouring_lines True
memory_mapping_engine auto
neighbour_lines 0 cm-1
optimization simple
parfuncfmt hapi
parsum_mode full summation
pseudo_continuum_threshold 0
sparse_ldm True
truncation 50 cm-1
waveunit cm-1
wstep 0.01 cm-1
zero_padding 40002
----------------------------------------
0.06s - Spectrum calculated
<radis.spectrum.spectrum.Spectrum object at 0x7fbdf0c99840>
Total running time of the script: (0 minutes 0.120 seconds)