ess.reflectometry.data¶
This is the super-class for raw reflectometry data for reduction.
From this super-class, instrument specfic sub-classes may be created (see for example the ess.amor.AmorData
class).
- class ess.reflectometry.data.ReflData(data, sample_angle_offset=<scipp.Variable> () int64 [deg] [0], gravity=True, beam_size=<scipp.Variable> () float64 [m] [0.001000], sample_size=<scipp.Variable> () float64 [m] [0.010000], detector_spatial_resolution=<scipp.Variable> () float64 [m] [0.002500], data_file=None)¶
Bases:
object
The general reflectometry data class. This will be used by the instrument specific sub-class for data storage and reduction.
- Args:
data (
scipp._scipp.core.DataArray
orstr
): The data to be reduced or the path to the file to be reduced. sample_angle_offset (scipp.Variable
, optional): Correction for omega or possibly misalignment of sample. Optional, default0 degrees of arc
. gravity (bool
, optional): Should gravity be accounted for. Optional, defaultTrue
. beam_size (scipp._scipp.core.Variable
, optional): Size of the beam perpendicular to the scattering surface. Optional, default0.001 m
. sample_size (scipp._scipp.core.Variable
, optional): Size of the sample in direction of the beam. Optional, default0.01 m
. detector_spatial_resolution (scipp._scipp.core.Variable
, optional): Spatial resolution of the detector. Optional, default2.5 mm
. data_file (str
): If ascipp._scipp.core.DataArray
is given as thedata
, adata_file
should be defined for output in the file. Optional, defaultNone
.
- detector_masking(x_min=None, x_max=None, y_min=None, y_max=None, z_min=None, z_max=None)¶
Masking on detector pixels.
- Args:
x_min (
scipp._scipp.core.Variable
, optional): Minimum x-dimension to be used. Optional, default no minimum mask. x_max (scipp._scipp.core.Variable
, optional): Maximum x-dimension to be used. Optional, default no maximum mask. y_min (scipp._scipp.core.Variable
, optional): Minimum y-dimension to be used. Optional, default no minimum mask. y_max (scipp._scipp.core.Variable
, optional): Maximum y-dimension to be used. Optional, default no maximum mask. z_min (scipp._scipp.core.Variable
, optional): Minimum z-dimension to be used. Optional, default no minimum mask. z_max (scipp._scipp.core.Variable
, optional): Maximum z-dimension to be used. Optional, default no maximum mask.
- property event¶
Return the event data buffer.
- Returns
(
scipp._scipp.core.DataArrayView
): Event data information.
- find_qz()¶
Calculate the scattering vector (and resolution).
- find_theta()¶
Calculate the theta angle (and resolution) with or without a gravity correction.
- find_wavelength()¶
From the time-of-flight data, find the wavelength for each neutron event.
- illumination()¶
Perform illumination correction.
- q_bin(bins)¶
Return data that has been binned in the q-bins passed.
- Args:
bins (
array_like
): q-bin edges. unit (scipp._scipp.core.Unit
): Unit for q. Defaults to 1/Å.- Returns:
(
scipp._scipp.core.DataArray
): Data array binned into qz with resolution.
- q_theta_bin(bins)¶
Return data that has been binned in the q and theta bins passed.
- Parameters
bins – q and theta edges
- Type
Tuple(scipp._scipp.core.Variable)
- Returns
Data array binned into q and theta
- Return type
scipp._scipp.core.DataArray
- theta_masking(theta_min=None, theta_max=None)¶
Masking data based on reflected angle.
- Args:
theta_min (
scipp._scipp.core.Variable
, optional): Minimum theta to be used. Optional, default no minimum mask. theta_max (scipp._scipp.core.Variable
, optional): Maximum theta to be used. Optional, default no maximum mask.
- wavelength_masking(wavelength_min=None, wavelength_max=None)¶
Masking data based on wavelength.
- Args:
wavelength_min (
scipp._scipp.core.Variable
, optional): Minimum wavelength to be used. Optional, default no minimum mask. wavelength_max (scipp._scipp.core.Variable
, optional): Maximum wavelength to be used. Optional, default no maximum mask.
- wavelength_q_bin(bins)¶
Return data that has been binned in the wavelength and q bins passed.
- Parameters
bins – q and theta edges
- Type
Tuple(scipp._scipp.core.Variable)
- Returns
Data array binned into wavelength and q
- Return type
scipp._scipp.core.DataArray
- wavelength_theta_bin(bins)¶
Return data that has been binned in the wavelength and theta bins passed.
- Parameters
bins (Tuple(scipp._scipp.core.Variable)) – wavelength and theta edges
- Returns
Data array binned into wavelength and theta
- Return type
scipp._scipp.core.DataArray
- write_reflectometry(filename, bins, header=None)¶
Write the reflectometry intensity data to a file.
- Args:
filename (
str
): The file path for the file to be saved to. bin_kwargs (dict
, optional): A dictionary of keyword arguments to be passed to theq_bin()
class method. Optional, default is that defaultq_bin()
keywords arguments are used. header (ess.reflectometry.Orso
, optional): ORSO-compatible header object. Optional defaults toReflData.orso
.
- write_wavelength_theta(filename, bins, header=None)¶
Write the reflectometry intensity data as a function of wavelength-theta to a file.
- Args:
filename (
str
): The file path for the file to be saved to. bins (tuple
ofarray_like
): wavelength and theta edges. header (ess.reflectometry.Orso
, optional): ORSO-compatible header object. Optional defaults toReflData.orso
.