neutronpy.data.Data

class neutronpy.data.Data(Q=None, h=0.0, k=0.0, l=0.0, e=0.0, temp=0.0, detector=0.0, monitor=0.0, error=None, time=0.0, time_norm=False, **kwargs)[source]

Data class for handling multi-dimensional scattering data. If input file type is not supported, data can be entered manually.

Parameters:
Q : array_like, optional

Default: None. Q in a column oriented array of [qx, qy, qz, ℏω, T]

h : ndarray or float, optional

Default: 0. Array of Qx in reciprocal lattice units.

k : ndarray or float, optional

Default: 0. Array of Qy in reciprocal lattice units.

l : ndarray or float, optional

Default: 0. Array of Qx in reciprocal lattice units.

e : ndarray or float, optional

Default: 0. Array of ℏω in meV.

temp : ndarray or float, optional

Default: 0. Array of sample temperatures in K.

detector : ndarray or float, optional

Default: 0. Array of measured counts on detector.

monitor : ndarray or float, optional

Default: 0. Array of measured counts on monitor.

time : ndarray or float, optional

Default: 0. Array of time per point in minutes.

time_norm : bool, optional

Default: False. If True, calls to intensity and error with normalize to time instead of monitor

Attributes:
h

Returns lattice parameter qx, i.e. h

k

Returns lattice parameter qy, i.e. k

l

Returns lattice parameter qz, i.e. l

e

Returns energy transfer

temp

Returns temperature

intensity

Returns the monitor or time normalized intensity

error

Returns error of monitor or time normalized intensity

detailed_balance_factor

Returns the detailed balance factor (sometimes called the Bose

Methods

bin(to_bin[, build_hkl]) Rebin the data into the specified shape.
combine_data(obj, **kwargs) Combines multiple data sets
subtract_background(background_data[, x, ret]) Subtract background data.
integrate([bounds, background, hkle]) Returns the integrated intensity within given bounds
position([bounds, background, hkle]) Returns the position of a peak within the given bounds
width([bounds, background, fwhm, hkle]) Returns the mean-squared width of a peak within the given bounds
estimate_background(bg_params) Estimate the background according to type specified.
subtract_background(background_data[, x, ret]) Subtract background data.
dynamic_susceptibility(material, ei) Returns the dynamic susceptibility \(\chi^{\prime\prime}(\mathbf{Q},\hbar\omega)\)
scattering_function(material, ei) Returns the neutron scattering function, i.e.
plot([x, y, z, w, show_err, to_bin, …]) Plots the data in the class.
plot_volume(x, y, z, w[, to_bin, …]) Plots a 3D volume of 4D data
plot_contour(x, y, z[, to_bin, …]) Method for plotting a 2D contour plot of 3D data
plot_line(x, y[, show_err, to_bin, …]) Method to Plot a line of 2D data
get_keys(hkle) Returns all of the Dictionary key names
get_bounds(bounds) Generates a to_fit tuple if bounds is present in kwargs