tof.Result#
- class tof.Result(source, choppers, detectors)[source]#
Result of a simulation.
- Parameters:
Methods
__init__
(source, choppers, detectors)plot
([visible_rays, blocked_rays, figsize, ...])Plot the time-distance diagram for the instrument, including the rays of neutrons that make it to the furthest detector.
to_nxevent_data
([key])Convert a detector reading to event data that resembles event data found in a NeXus file.
Attributes
The choppers in the model.
The detectors in the model.
The source of neutrons.
- property choppers: mappingproxy[str, ChopperReading]#
The choppers in the model.
- property detectors: mappingproxy[str, DetectorReading]#
The detectors in the model.
- plot(visible_rays=1000, blocked_rays=0, figsize=None, ax=None, cax=None, cbar=True, cmap='gist_rainbow_r')[source]#
Plot the time-distance diagram for the instrument, including the rays of neutrons that make it to the furthest detector. As plotting many lines can be slow, the number of rays to plot can be limited by setting
visible_rays
. In addition, it is possible to also plot the rays that are blocked by choppers along the flight path by settingblocked_rays > 0
.- Parameters:
visible_rays (
int
, default:1000
) – Maximum number of rays to plot.blocked_rays (
int
, default:0
) – Number of blocked rays to plot.figsize (
Optional
[tuple
[float
,float
]], default:None
) – Figure size.ax (
Optional
[Axes
], default:None
) – Axes to plot on.cax (
Optional
[Axes
], default:None
) – Axes to use for the colorbar.cbar (
bool
, default:True
) – Show a colorbar for the wavelength ifTrue
.cmap (
str
, default:'gist_rainbow_r'
) – Colormap to use for the wavelength colorbar.
- Return type:
- property source: SourceParameters#
The source of neutrons.