tsadar.core.physics.irf#
Functions
|
Applies a 2D Gaussian smoothing to angular Thomson scattering data to account for the instrument response function (IRF) of the diagnostic. |
|
Applies an instrumental response function (IRF) to an electron model spectrum and normalizes the result. |
|
Applies an instrumental response function (IRF) to the ion spectral model and optionally normalizes the result. :param config: Configuration dictionary containing physical parameters, including the standard deviation of the Gaussian IRF ('spect_stddev_ion') and normalization flag ('norm'). :type config: dict :param lamAxisI: Wavelength axis for the ion spectrum. :type lamAxisI: jnp.ndarray :param modlI: Theoretical ion spectrum model to which the IRF will be applied. :type modlI: jnp.ndarray :param amps: Amplitude scaling factor(s) for the spectrum. :type amps: float or jnp.ndarray :param TSins: Dictionary containing additional scaling parameters, specifically 'general' -> 'amp3'. :type TSins: dict. |
- tsadar.core.physics.irf.add_ATS_IRF(config, sas, lamAxisE, modlE, amps, TSins) Tuple[Array, Array]Source#
Applies a 2D Gaussian smoothing to angular Thomson scattering data to account for the instrument response function (IRF) of the diagnostic. This function convolves the synthetic spectra with Gaussian kernels along both the wavelength and angular axes, simulating the broadening effects introduced by the instrument. The resulting spectrum is optionally normalized according to configuration parameters. :param config: Configuration dictionary containing instrument and normalization parameters. :type config: dict :param sas: Dictionary with keys ‘sa’ (scattering angles in degrees) and ‘weights’ (normalized relative weights for each angle). :type sas: dict :param lamAxisE: Array of wavelengths (in nm) at which the spectrum is computed. :type lamAxisE: jnp.ndarray :param modlE: Synthetic spectra produced by the formfactor routine, shape (n_angles, n_wavelengths). :type modlE: jnp.ndarray :param amps: Maximum amplitude of the data, used to rescale the model to the data. :type amps: float :param TSins: Dictionary of Thomson scattering instrument parameters and their values. :type TSins: dict
- Returns:
lamAxisE (jnp.ndarray) – Wavelength axis (in nm). ThryE (jnp.ndarray): Smoothed and optionally normalized synthetic spectra, shape (n_angles, n_wavelengths).
- tsadar.core.physics.irf.add_ion_IRF(config, lamAxisI, modlI, amps, TSins) Tuple[Array, Array]Source#
Applies an instrumental response function (IRF) to the ion spectral model and optionally normalizes the result. :param config: Configuration dictionary containing physical parameters, including the standard deviation
of the Gaussian IRF (‘spect_stddev_ion’) and normalization flag (‘norm’).
- Parameters:
lamAxisI (jnp.ndarray) – Wavelength axis for the ion spectrum.
modlI (jnp.ndarray) – Theoretical ion spectrum model to which the IRF will be applied.
amps (float or jnp.ndarray) – Amplitude scaling factor(s) for the spectrum.
TSins (dict) – Dictionary containing additional scaling parameters, specifically ‘general’ -> ‘amp3’.
- Returns:
lamAxisI (jnp.ndarray) – The wavelength axis, possibly averaged over batches if the IRF is applied. ThryI (jnp.ndarray): The processed ion spectrum after convolution with the IRF and optional normalization.
- tsadar.core.physics.irf.add_electron_IRF(config, lamAxisE, modlE, amps, TSins) Tuple[Array, Array]Source#
Applies an instrumental response function (IRF) to an electron model spectrum and normalizes the result. This function convolves the input electron model spectrum (modlE) with a Gaussian IRF defined by the configuration, normalizes the convolved spectrum according to the provided configuration and signal parameters, and optionally averages and rescales the output based on normalization settings. :param config: Configuration dictionary containing physical parameters, including the IRF width and normalization settings. :type config: dict :param lamAxisE: Wavelength axis for the electron spectrum. :type lamAxisE: jnp.ndarray :param modlE: Model electron spectrum to which the IRF will be applied. :type modlE: jnp.ndarray :param amps: Amplitude scaling factor(s) for the output spectrum. :type amps: float or jnp.ndarray :param TSins: Dictionary containing signal parameters, including normalization wavelengths and amplitudes. :type TSins: dict
- Returns:
lamAxisE (jnp.ndarray) – The wavelength axis, possibly averaged over batches if the IRF is applied. ThryE (jnp.ndarray): The processed electron spectrum after convolution with the IRF and optional normalization. Tuple[jnp.ndarray, jnp.ndarray]: Tuple containing the (possibly averaged) wavelength axis and the processed, normalized electron spectrum.