tof.InelasticSample#
- class tof.InelasticSample(distance, name, delta_e)[source]#
An inelastic sample component changes the energy of the neutrons that pass through it, but does not block any.
- Parameters:
distance (
Variable) – The distance from the source to the inelastic sample.name (
str) – The name of the inelastic sample.delta_e (
Callable[[Variable],Variable]) – The change in energy applied to the neutrons as they pass through the inelastic sample. This should be a function or callable that takes the incident energy and returns the final energy.
Methods
__init__(distance, name, delta_e)apply(neutrons, time_limit)Apply the change in energy to the given neutrons.
as_dict()Return the inelastic sample as a dictionary.
as_json()Return the inelastic sample as a JSON-serializable dictionary.
as_readonly(neutrons)from_json(name, params)Create an inelastic sample from a JSON-serializable dictionary.
plot(**kwargs)Attributes
kind- apply(neutrons, time_limit)[source]#
Apply the change in energy to the given neutrons. The convention is that
\[\Delta E = E_i - E_f\]where \(E_i\) is the initial energy and \(E_f\) is the final energy.
- as_json()[source]#
Return the inelastic sample as a JSON-serializable dictionary. .. versionadded:: 26.03.0
- Return type: