CARSSimulator setup

NTECARS.GasConditionsType
GasConditions(; pressure, T_gas) -> GasConditions

Constructs a GasConditions the gas temperature and pressure used for linewidth calculations

Constructor Arguments

  • pressure::AbstractFloat: Gas pressure in Pa.
  • T_gas::AbstractFloat: Translational temperature in K.

Fields of returned type

  • pressure::AbstractFloat: Gas pressure in Pa.
  • T_gas::AbstractFloat: Translational temperature in K.

Notes

  • T_gas represents the translational temperature and is used for linewidth calculations. It should match T_rot of the species distributions when assuming rotational equilibrium.

Examples

conditions = GasConditions(
    pressure = 15000.0,  # 150 mbar
    T_gas    = 600.0     # K
)
source
NTECARS.InstrumentConfigurationType
InstrumentConfiguration(; profile=DeltaProfile()) -> InstrumentConfiguration

Constructs an InstrumentConfiguration storing the instrumental broadening profile of the spectrometer or other measurement devices and returns it.

Constructor Arguments

  • profile::Union{DeltaProfile, Spectrum}: Instrumental broadening profile, centred around 0. Use DeltaProfile() if no instrumental broadening is present. For standard profiles, convenience constructors are implemented: Gaussian, Voigt, PowerVoigt. A spectrum from use data can be passed in the form of a Spectrum.The profile does not have to be symmetric.

Fields of returned type

  • profile::Union{DeltaProfile, Spectrum}: The instrumental broadening profile.

Examples

# No instrumental broadening
instrument = InstrumentConfiguration()

# Gaussian broadening with FWHM = 0.2 cm⁻¹
instrument = InstrumentConfiguration(profile = Gaussian(0.2/2.355))

# Measured instrument profile from data
instrument = InstrumentConfiguration(
    profile = Spectrum(wavenumbers, intensities, :wavenumber))
source
NTECARS.LaserConfigurationType
LaserConfiguration(; wavelength_1, wavelength_2, stokes_range,
                     profile_1=DeltaProfile(), profile_2=DeltaProfile(),
                     stokes_profile=FlatProfile()) -> LaserConfiguration

Constructs a LaserConfiguration storing the laser wavelengths and spectral profiles.

Constructor Arguments

  • wavelength_1::Float64: Central wavelength of the first laser in meters.
  • wavelength_2::Float64: Central wavelength of the second laser in meters.
  • stokes_range::Tuple{Float64,Float64}: Wavelength range over which the Stokes spectrum is defined, in meters. Together with the laser wavelengths, this determines the simulated anti-Stokes frequency range.
  • profile_1::Union{DeltaProfile, Spectrum}: Spectral profile of the first laser. Use DeltaProfile() for an ideal monochromatic laser.
  • profile_2::Union{DeltaProfile, Spectrum}: Spectral profile of the second laser.
  • stokes_profile::Union{FlatProfile, Spectrum}: Stokes spectral profile defined at the physical Stokes wavelength range (not around 0). Use FlatProfile() if the experimental data is already normalised by the Stokes profile or non-resonant background.

Fields of returned type

  • ν_1::Float64: Central wavenumber of the first laser in cm⁻¹.
  • ν_2::Float64: Central wavenumber of the second laser in cm⁻¹.
  • profile_1::Union{DeltaProfile, Spectrum}: Spectral profile of the first laser.
  • profile_2::Union{DeltaProfile, Spectrum}: Spectral profile of the second laser.
  • stokes_profile::Spectrum: Stokes spectral profile.
  • ν_aS_limits::Tuple{Float64,Float64}: Anti-Stokes wavenumber limits in cm⁻¹, computed as extrema(ν₁ + ν₂ − ν_S).

Notes

  • Wavelengths are converted to wavenumbers internally. All spectral fields are stored in cm⁻¹.
  • For standard profiles convenience constructors are implemented: Gaussian, Voigt, PowerVoigt

Examples

# Ideal lasers with flat Stokes background
lasers = LaserConfiguration(
    wavelength_1 = 532e-9,
    wavelength_2 = 561e-9,
    stokes_range = (600e-9, 610e-9),
)

# Broadened lasers with measured Stokes profile
lasers = LaserConfiguration(
    wavelength_1 = 532e-9,
    wavelength_2 = 561e-9,
    stokes_range = (600e-9, 610e-9),
    profile_1    = Gaussian(0.2),
    profile_2    = Voigt(0.1, 0.05),
    stokes_profile = Spectrum([600e-9, 605e-9, 610e-9], [0.0, 1.0, 0.0], :wavelength)
)
source
NTECARS.CARSSimulatorType
CARSSimulator(; species, conditions, lasers, instrument, grid_type=:adaptive,
                vertical_shift=0.0, wavelength_shift=0.0) -> CARSSimulator

Constructs a CARSSimulator containing all information required to simulate a CARS spectrum.

Constructor Arguments

  • species::Vector{T} where {T<:CARSSpecies}: Vector of species to simulate.
  • conditions::GasConditions: Bulk gas parameters used for calculating linewidths.
  • lasers::LaserConfiguration: Laser wavelengths and spectral profiles.
  • instrument::InstrumentConfiguration: Instrumental broadening profile.
  • grid_type::Symbol: Can be :adaptive or :uniform.
  • vertical_shift::Float64: Vertical offset added after the specturm is normalized to its maximum.
  • wavelength_shift::Float64: Horizontal shift of the anti-Stokes wavelength axis in meters, i.e. the output is evaluated at λ_aS + wavelength_shift. Used to account for calibration offsets.

Fields of returned type

  • species::Vector{CARSSpecies}: Vector of species used in the simulation.
  • conditions::GasConditions: Bulk gas conditions.
  • lasers::LaserConfiguration: Laser configuration.
  • instrument::InstrumentConfiguration: Instrumental broadening profile.
  • grid::Union{UniformGrid, AdaptiveGrid}: Spectral grid.
  • vertical_shift::Float64: Vertical offset of the normalised spectrum.
  • wavelength_shift::Float64: Horizontal wavelength shift in meters.

Notes

  • The spectral grid is constructed once at initialisation. If conditions, species, or lasers are changed after construction, the grid is not automatically updated. Reconstruct the CARSSimulator if the grid needs to reflect the new parameters.
source