tsadar.core.thomson_diagnostic#
Classes
|
The SpectrumCalculator class wraps the FitModel class adding instrumental effects to the calculated spectrum so it can be compared to data. |
- class tsadar.core.thomson_diagnostic.ThomsonScatteringDiagnostic(cfg, scattering_angles)Source#
The SpectrumCalculator class wraps the FitModel class adding instrumental effects to the calculated spectrum so it can be compared to data.
Notes
This Class will eventually be combined with FitModel in generate_spectra
- Parameters:
cfg – Dict- configuration dictionary built from input deck
scattering_angles – Dict- has fields containing the scattering angles the spectrum will be calculated at and the relative
spectrum (weights of each of the scattering angles in the final)
- postprocess_theory(modlE, modlI, lamAxisE, lamAxisI, amps, TSins)Source#
Adds instrumental broadening to the synthetic Thomson spectrum.
- Parameters:
modlE – Synthetic EPW Thomson spectra produced by FitModel
modlI – Synthetic IAW Thomson spectra produced by FitModel
lamAxisE – EPW wavelength axis produced by FitModel
lamAxisI – IAW wavelength axis produced by FitModel
amps – dictionary containing the scaling facotrs for
TSins – dictionary of the Thomson scattering parameters
- Returns:
ThryE – Synthetic Thomson spectrum with instrumental broadening ThryI: Synthetic Thomson spectrum with instrumental broadening lamAxisE: EPW wavelength axis lamAxisI: IAW wavelength axis
- reduce_ATS_to_resunit(ThryE, lamAxisE, TSins, batch)Source#
Integrate synthetic angularly resolved Thomson spectra over a resolution unit. A resolution unit is 2D with a width in the spectral and angular domains.
- Parameters:
ThryE – Synthetic angularly resolved spectrum
lamAxisE – calibrated wavelength axis, should have a length equal to one dimension of ThryE
TSins – dictionary of the Thomson scattering parameters
batch – dictionary containing the data and amplitudes
- Returns:
ThryE – The input synthetic angularly resolved spectrum integrated of the resolution unit and correspondingly downsized lamAxisE: the input wavelength axis integrated over a wavelngth resolution unit and correspondingly downsized
- __call__(ts_params: ThomsonParams, batch)Source#
Simulates the Thomson scattering diagnostic for a given set of parameters and input data by adding instrumental effects to the calculated spectrum. :param ts_params: Object containing all the physical and experimental parameters required for the simulation. :type ts_params: ThomsonParams :param batch: Dictionary containing electron and ion data arrays, amplitude arrays, and noise arrays.
- Expected keys include:
“e_amps”: Electron amplitude array.
“i_amps”: Ion amplitude array.
“noise_e”: Noise array for electrons.
“noise_i”: Noise array for ions.
- Returns:
ThryE (np.ndarray) – Simulated electron spectrum with noise added. ThryI (np.ndarray): Simulated ion spectrum with noise added. lamAxisE (np.ndarray): Wavelength axis for electron spectrum. lamAxisI (np.ndarray): Wavelength axis for ion spectrum.
Notes
Applies post-processing to theoretical spectra and optionally reduces the spectrum to the resolution unit if specified in the configuration.
Adds experimental noise to the simulated spectra before returning.
- spectrum_breakdown(ts_params: ThomsonParams, batch)Source#
Alternative version of the __call__ method which produces a detailied beakdown of all componenets that go into the calculated spectrum. Not intended to be used for angular data.
- Parameters:
ts_params (ThomsonParams) – Object containing all the physical and experimental parameters required for the simulation.
batch (dict) – Dictionary containing electron and ion data arrays, amplitude arrays, and noise arrays.
- Returns:
modlE (np.ndarray) – Electron spectrum with instrumental effects applied. modlI (np.ndarray): Ion spectrum with instrumental effects applied. ThryE (np.ndarray): Raw theoretical electron spectrum. ThryI (np.ndarray): Raw theoretical ion spectrum. eIRF (np.ndarray): Electron IRF spectrum. iIRF (np.ndarray): Ion IRF spectrum. lamAxisE (np.ndarray): Wavelength axis for electron spectrum. lamAxisI (np.ndarray): Wavelength axis for ion spectrum. lamAxisE_raw (np.ndarray): Raw wavelength axis for electron spectrum. lamAxisI_raw (np.ndarray): Raw wavelength axis for ion spectrum.