resins.models.vision_paper module
Model for TOSCA-like instruments from the [VISION-paper].
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.
- class resins.models.vision_paper.VisionPaperModel(model_data: VisionPaperModelData, **_)
Bases:
GaussianKernel1DMixin,SimpleBroaden1DMixin,InstrumentModelModel for TOSCA-like instruments from the [VISION paper]_.
Models the resolution as a function of energy transfer (frequencies) only, with the output model being an Ikeda-Carpenter distribution. 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_qarray expected by all computation methods, i.e. the names of the independent variables ([Q, w]) that the model models.data_classData for the
VisionPaperModelmodel.citationThe citation for this model.
Methods
__call__(points, data, *meshes)Broadens the
dataon themeshes.broaden(points, data, mesh)Broadens the
dataon the fullmeshusing the straightforward scheme.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
meshat each (energy transfer or momentum scalar) point inpoints.get_peak(points, mesh)Computes the Gaussian broadening peak on the provided
meshat each (energy transfer or momentum scalar) point inpoints.- data_class
alias of
VisionPaperModelData
- 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).
- Parameters:
- points
The energy transfer in meV at which to compute the width in sigma of the kernel. This must be a
samplex 1 2D array wheresampleis the number of energy transfers.
- Returns:
characteristicsThe characteristics of the broadening function, i.e. the Gaussian width as sigma.
- class resins.models.vision_paper.VisionPaperModelData(*, 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, sample_thickness: float, detector_thickness: float, crystal_plane_spacing: float, d_r: float, d_t: float, angles: list[float], distance_sample_analyzer: float, average_bragg_angle_graphite: float)
Bases:
ModelDataData for the
VisionPaperModelmodel.- 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 therangestyle (start, stop, step) tuple, and if it is aset, 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).- sample_thickness
Thickness of the sample in meters (m).
- detector_thickness
Thickness of the detector in meters (m).
- crystal_plane_spacing
Distance between the layers of atoms making up the detector, in meters (m).
- d_r
Uncertainty associated with the detector offset, in meters (m).
- d_t
Uncertainty associated with the source pulse shape, in ? (?).
- angles
Angle between the sample and the analyser, in degrees.
- distance_sample_analyzer
Distance between the sample and the analyser, in meters (m).
- average_bragg_angle_graphite
Average Bragg angle of the graphite analyser, in degrees.