data
This module contains both the Data class and the MeasurementBase class. In a reflectometry measurement, the experimental data corresponds to the reflected intensity as a function of scattering vector Q. In a typical diffractometer, Q is a virtual axis, calculated geometrically from various motor positions. The Data class takes care of these conversions, exposing q, theta, intensity, reflectivity, and energy.
The MeasurementBase class defines a simple class that is Data, but that also has metadata.
Module Contents
Classes
The base class of all Islatu objects that contain data. |
|
All measurements derive from this class. |
API
- class data.Data(intensity, intensity_e, energy, theta=None, q_vectors=None)
The base class of all Islatu objects that contain data.
- Attributes:
- intensity:
A numpy array containing intensities in this dataset.
- intensity_e:
A numpy array containing the corresponding errors in intensity.
- theta:
A numpy array containing the probe particle’s angle of incidence at each intensity.
- q_vectors:
A numpy array containing the magnitude of the probe particle’s scattering vector for each intensity value.
- energy:
The energy of the probe particle used to acquire this data. This is necessary to swap between theta and q.
- Args:
- intensity:
A numpy array of the intensities in this dataset.
- intensity_e:
The errors on the intensities.
- energy:
The energy of the probe particle used to acquire this data.
- theta:
A numpy array containing the probe particle’s angle of incidence at each intensity. NOTE: only one of theta/q needs to be provided.
- q_vectors:
A numpy array containing the magnitude of the probe particle’s scattering vector for each intensity value. NOTE: only one of theta/q needs to be provided.
Initialization
- property reflectivity: numpy.array
Returns the intensity, normalized such that the maximum value of the intensity is equal to 1. To acquire
- property reflectivity_e: numpy.array
Returns the errors on the intensity, divided by the maximum value of the intensity array.
- property reflectivity_nonorm: numpy.array
Returns the intensity, unnormalised
- property reflectivity_e_nonorm: numpy.array
Returns the errors on the intensity, unnormalised
- property q_vectors: numpy.array
Returns self._q if this instance of Data was generated from q-data. Otherwise, converts from self._theta to q.
- property theta: numpy.array
Returns self._theta if this instance of Data was generate from th-data. Otherwise, converts from scattered q to theta.
- _theta_to_q(theta, energy) numpy.array
Calculates the scattering vector Q from diffractometer theta.
- Args:
- theta (
str): Array of theta values to be converted.
- energy (
float): Energy of the incident probe particle.
- theta (
- _q_to_theta(q_values, energy) numpy.array
Calculates the diffractometer theta from scattering vector Q.
- Args:
- theta (
str): Array of theta values to be converted.
- energy (
float): Energy of the incident probe particle.
- theta (
- remove_data_points(indices)
Convenience method for the removal of a specific data point by its index.
- Args:
- indices:
The indices to be removed.