Thomson Scattering

Example code demonstrating the use of ThomsonScattering can be found in the jupyter notebook demo.

class sims.instruments.ThomsonScattering(R: ndarray, z: ndarray, weights: ndarray, interface: SolpsInterface = None, measurements: dict[str, numpy.ndarray] = None)

Synthetic instrument model for Thomson scattering.

Parameters
  • R – Radius positions of the sampling points as a 2D numpy array of shape (num_channels, num_samples).

  • z – z-positions of the sampling points as a 2D numpy array of shape (num_channels, num_samples).

  • weights – weighting values of the sampling points as a 2D numpy array of shape (num_channels, num_samples).

  • interface – An instance of the SolpsInterface class. If the interface cannot be passed when creating the instance of ThomsonScattering, it can be specified later using the update_interface method.

  • measurements – A dictionary containing Thomson-scattering measurement data to which the synthetic instrument predictions will be compared. The data should be given as 1D numpy arrays under the keys ‘te_data’, ‘te_err’, ‘ne_data’ and ‘ne_err’. This keyword argument is required in order to use the log_likelihood method.

log_likelihood(likelihood=<function gaussian_likelihood>) float

Calculate the log-likelihood of the experimental data for the given SOLPS data.

Parameters

likelihood – The likelihood function used in the calculation. By default, a Gaussian likelihood is used. Other likelihoods can be imported from the sims.likelihoods module and passed to change which likelihood is used.

Returns

The log-likelihood

update_interface(interface: SolpsInterface)

Set the SOLPS data which will be used by the instrument model by passing an instance of SolpsInterface from the sims.interface module.

Parameters

interface – An instance of SolpsInterface from the sims.interface module.