Learn how to manipulate the RADIS Spectrum object
See RADIS Documentation: Spectrum how to? for more information
Let's start by loading a test file:
%matplotlib inline
from radis.test.utils import getTestFile
from radis.tools.database import load_spec
s = load_spec(getTestFile('N2C_specair_380nm.spec'))
s.plot('radiance_noslit', Iunit='W/cm2/sr/nm')
<matplotlib.lines.Line2D at 0x22f854a61d0>
Print spectrum conditions:
print(s)
Spectrum Name: N2C_specair_380nm Spectral Quantities ---------------------------------------- radiance_noslit (2,500 points) transmittance_noslit (2,500 points) Populations Stored ---------------------------------------- Physical Conditions ---------------------------------------- Tgas 1500 Trot 1500 Tvib 3000 medium air path_length 0.05 pressure_mbar 1000.0 rot_distribution boltzmann self_absorption True thermal_equilibrium False vib_distribution boltzmann wavelength_max 385.0000 nm wavelength_min 360.0000 nm Computation Parameters ---------------------------------------- VERSION_STRING 3.1.1 absco2 0 absh2o 0.0 atomic_radiation {} bandoriginsaver 0 cutoff 0 d 0 idatabase 1 igas 1 io2 0 iother 1 isave 0 islit 0 iwavel 1 jobName N2C_specair_380nm molecular_radiation {'N2_Birge-Hopfield_1': True, 'N2_FirstPositive': True, 'N2_Worley_o3-X': True, 'N2_Carrol-Yoshino':... mstart 1 mstep 1 narray 2500 nas 4 nbs 37 nlayer 1 nms 9 nprt1 2 nprt2 1 results_directory /home/erwan/specair/pyspecair/test_specair/radiation/specair/specair_simulation/N2C_specair_380nm waveunit nm wco2 0.0 wh2o 0.0 wo2 0.0 xco2 0 xh2o 0.0 ----------------------------------------
Get Spectrum name:
s.get_name()
'N2C_specair_380nm'
Get some spectrum properties:
s.get_radiance_noslit(Iunit='W/m2/sr/nm')
array([ 72696.45837129, 1976.176202 , 77884.91018279, ..., 189439.51324438, 118932.97245235, 42841.24892344])
Integrate to get the radiative power:
s.get_power(unit='W/cm2/sr')
2631.6288408588148
Apply a slit function, plot it:
s.apply_slit(0.5, 'nm')
s.plot_slit()
(<Figure size 640x480 with 1 Axes>, <matplotlib.axes._subplots.AxesSubplot at 0x22f854ece80>)
Rescale the path length
s.rescale_path_length(0.1)
<radis.spectrum.spectrum.Spectrum at 0x22f85444a20>