resins.models.tosca_book module

Model for the TOSCA instrument from the [INS-book].

All classes within are exposed for reference only and should not be instantiated directly. For obtaining the resolution function of an instrument, please use the resins.instrument.Instrument.get_resolution_function method.

[INS-book]

PCH Mitchell, SF Parker, AJ Ramirez-Cuesta and J Tomkinson, Vibrational Spectroscopy with Neutrons With Applications in Chemistry, Biology, Materials Science and Catalysis, World Scientific Publishing Co. Pte. Ltd., Singapore, 2005.

class resins.models.tosca_book.ToscaBookModel(model_data: ToscaBookModelData, **_)

Bases: GaussianKernel1DMixin, SimpleBroaden1DMixin, InstrumentModel

Model for the TOSCA instrument from the [INS book]_.

Models the resolution as a function of energy transfer (frequencies) only, with the output model being a Gaussian. This is done by taking into account the contributions from the various parts of the instrument (for more information, please see the reference).

Parameters:
model_data

The data associated with the model for a given version of a given instrument.

Attributes:
input

The names of the columns in the omega_q array expected by all computation methods, i.e. the names of the independent variables ([Q, w]) that the model models.

data_class

Data for the ToscaBookModel model.

citation

The citation for this model.

Methods

__call__(points, data, *meshes)

Broadens the data on the meshes.

broaden(points, data, mesh)

Broadens the data on the full mesh using the straightforward scheme.

data_class

get_characteristics(points)

Computes the broadening width at each value of energy transfer given by points.

get_kernel(points, mesh)

Computes the Gaussian kernel centered on zero on the provided mesh at each (energy transfer or momentum scalar) point in points.

get_peak(points, mesh)

Computes the Gaussian broadening peak on the provided mesh at each (energy transfer or momentum scalar) point in points.

data_class

alias of ToscaBookModelData

get_characteristics(points: Float[np.ndarray, 'energy_transfer dimension=1']) dict[str, Float[np.ndarray, 'sigma']]

Computes the broadening width at each value of energy transfer given by points.

The model approximates the broadening using the Gaussian distribution, so the returned widths are in the form of the standard deviation (sigma) in meV.

Parameters:
points

The energy transfer in meV at which to compute the width in sigma of the kernel. This must be a sample x 1 2D array where sample is the number of energy transfers.

Returns:
characteristics

The characteristics of the broadening function, i.e. the Gaussian width as sigma.

class resins.models.tosca_book.ToscaBookModelData(*, function: str, citation: list[str], defaults: dict[str, int | float], restrictions: dict[str, list[int | float], set[int | float]], primary_flight_path: float, primary_flight_path_uncertainty: float, water_moderator_constant: int, time_channel_uncertainty: int, sample_thickness: float, graphite_thickness: float, detector_thickness: float, sample_width: float, detector_width: float, crystal_plane_spacing: float, angles: list[float], average_secondary_flight_path: float, average_final_energy: float, average_bragg_angle_graphite: float, change_average_bragg_angle_graphite: float)

Bases: ModelData

Data for the ToscaBookModel model.

Attributes:
function

The name of the function, i.e. the alias for PantherAbINSModel.

citation

The citation for the model. Please use this to look up more details and cite the model.

restrictions

All constraints that the model places on the settings. If the value is a list, this signifies the range style (start, stop, step) tuple, and if it is a set, it is a set of explicitly allowed values.

defaults

The default values for the settings, used when a value is not provided when creating the model.

primary_flight_path

Distance between the moderator and the sample in meters (m).

primary_flight_path_uncertainty

The uncertainty associated with the primary_flight_path, in meters (m).

water_moderator_constant

Moderator constant, in the units of $hbar^2$.

time_channel_uncertainty

Time channel uncertainty in microseconds (us).

sample_thickness

Thickness of the sample in meters (m).

graphite_thickness

Thickness of the graphite analyser in meters (m).

detector_thickness

Thickness of the detector in meters (m).

sample_width

Width of the sample in meters (m).

detector_width

Width of the detector in meters (m).

crystal_plane_spacing

Distance between the layers of atoms making up the detector, in meters (m).

angles

Angle between the sample and the analyser, in degrees.

average_secondary_flight_path

Average length of the path from the sample to the detector in meters (m).

average_final_energy

Average energy of the neutrons hitting the detector in meV.

average_bragg_angle_graphite

Average Bragg angle of the graphite analyser, in degrees.

change_average_bragg_angle_graphite

Uncertainty associated with average_bragg_angle_graphite.