tof.Detector#

class tof.Detector(distance, name)[source]#

A detector component does not block any neutrons, it sees all neutrons passing through it.

Parameters:
  • distance (Variable) – The distance from the source to the detector.

  • name (str) – The name of the detector.

__init__(distance, name)[source]#

Methods

__init__(distance, name)

apply(neutrons, time_limit)

Apply the detector to the given neutrons.

as_dict()

Return the detector as a dictionary.

as_json()

Return the detector as a JSON-serializable dictionary.

as_readonly(neutrons)

from_json(name, params)

Create a detector from a JSON-serializable dictionary.

Attributes

kind

apply(neutrons, time_limit)[source]#

Apply the detector to the given neutrons. A detector does not modify the neutrons, it simply records them without blocking any.

Parameters:
  • neutrons (DataArray) – The neutrons to which the detector will be applied.

  • time_limit (Variable) – The time limit for the neutrons to be considered as reaching the detector.

Return type:

tuple[DataArray, DetectorReading]

as_dict()[source]#

Return the detector as a dictionary.

Return type:

dict

as_json()[source]#

Return the detector as a JSON-serializable dictionary.

Added in version 25.11.0.

Return type:

dict

classmethod from_json(name, params)[source]#

Create a detector from a JSON-serializable dictionary.

Return type:

Detector