spectral_density_modelο
- plasmapy.diagnostics.thomson.spectral_density_model(wavelengths, settings, params)[source]ο
Returns a
lmfit.model.Modelfunction 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,Particleobjects, or aParticleListdescribing 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_massorion_zparameters 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 wavelengthQuantityarray 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 (
Parametersobject) βA
Parametersobject 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, β¦). TheParametersobject 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.Modelof 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.nanvalues β instead regions with no data should be removed from both the data and wavelength arrays usingnumpy.delete.