spectral_density_model
- plasmapy.diagnostics.thomson.spectral_density_model(wavelengths, settings, params)[source]
Returns a
lmfit.model.Model
function for Thomson spectral density function.- Parameters:
wavelengths (numpy.ndarray) – Wavelength array, in meters.
settings (dict) –
A dictionary of non-variable inputs to the spectral density function which must include the following keys:
"probe_wavelength"
: Probe wavelength in meters"probe_vec"
: (3,) unit vector in the probe direction"scatter_vec"
: (3,) unit vector in the scattering direction"ions"
: list of particle strings,Particle
objects, or aParticleList
describing each ion species. All ions must be positive. Ion mass and charge number from this list will be automatically added as fixed parameters, overridden by anyion_mass
orion_z
parameters explicitly created.
and may contain the following optional variables:
"electron_vdir"
: (e#, 3) array of electron velocity unit vectors"ion_vdir"
: (e#, 3) array of ion velocity unit vectors"instr_func"
: A function that takes a wavelengthQuantity
array and returns a spectrometer instrument function as anndarray
."notch"
: A wavelength range or array of multiple wavelength ranges over which the spectral density is set to 0.
These quantities cannot be varied during the fit.
params (
Parameters
object) –A
Parameters
object that must contain the following variables:n: Total combined density of the electron populations in m-3
T_e_e#
: Temperature in eVT_i_i#
: Temperature in eV
where where
i#
and wheree#
are replaced by the number of electron and ion populations, zero-indexed, respectively (e.g., 0, 1, 2, …). TheParameters
object may also contain the following optional variables:"efract_e#"
: Fraction of each electron population (must sum to 1)"ifract_i#"
: Fraction of each ion population (must sum to 1)"electron_speed_e#"
: Electron speed in m/s"ion_speed_ei"
: Ion speed in m/s"ion_mu_i#"
: Ion mass number, \(μ = m_i/m_p\)"ion_z_i#"
: Ion charge number"background"
: Background level, as fraction of max signal
These quantities can be either fixed or varying.
- Returns:
model – An
lmfit.model.Model
of the spectral density function for the provided settings and parameters that can be used to fit Thomson scattering data.- Return type:
Notes
If an instrument function is included, the data should not include any
numpy.nan
values — instead regions with no data should be removed from both the data and wavelength arrays usingnumpy.delete
.