# spectral_density_model

plasmapy.diagnostics.thomson.spectral_density_model(wavelengths, settings, params)

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 a ParticleList describing each ion species. All ions must be positive.

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 wavelength Quantity array and returns a spectrometer instrument function as an ndarray.

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 eV

• T_i_i# : Temperature in eV

where where i# and where e# are replaced by the number of electron and ion populations, zero-indexed, respectively (e.g., 0, 1, 2, …). The Parameters 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

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

lmfit.model.Model

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 using numpy.delete.