API: chopcal.nicos¶
BIFROST's chopper settings in the terms NICOS sets them.
nicos
¶
BIFROST chopper settings as NICOS sets them.
An ESS chopper controller does not take chopcal's delay. It locks its top-dead-centre
sensor to a total, which the EPICS module evr_seq_calc forms from three parts, in ns::
TotDly = MechDly / 360 / |Spd_S| * 1e9 + BeamPosDly + ChopDly
MechDly-S is measured for each disc, from its TDC to the centre of its reference
opening, so that with the other two at zero that centre is on the beam at the timing
reference (ECDC's Choppers page). BeamPosDly-S (the pulse delay) moves every disc
together and is fixed by the instrument team. ChopDly-S (the experiment delay) is what
an experiment sets, and the only delay NICOS writes, through <disc>_chopper_delay. So
the reference opening is centred on the beam pulse_delay + experiment_delay after the
reference, and nothing about the real disc's mounting enters what an experiment has to set.
chopcal's delay is when the disc point at beam is on the beam, which for every
chopper chopcal.bifrost describes is the centre of its one opening. Both are measured
from the proton pulse, so the experiment delay is chopcal's delay less the pulse delay.
NICOS's <disc>_chopper_speed writes Spd_S, which ESS counts positive clockwise
facing away from the source. chopcal's speeds, like NeXus's, are positive anticlockwise,
so NICOS is given them negated.
Functions:
-
bifrost–BIFROST's chopper settings, keyed by the NICOS device that takes each one.
-
experiment_delay–ESS
ChopDly-Sfor one chopper, in seconds, in[0, 1/|speed|).
Attributes:
NICOS_NAMES
module-attribute
¶
NICOS_NAMES = {'ps1': 'psc1', 'ps2': 'psc2', 'fo1': 'foc1', 'fo2': 'foc2', 'bw1': 'bwc1', 'bw2': 'bwc2'}
bifrost
¶
bifrost(pulse_delay, energy_min=None, wavelength_max=None, shaping_time=0.0002, apertures=True, pulse_shaping_speed_max=PULSE_SHAPING_SPEED_MAX)
BIFROST's chopper settings, keyed by the NICOS device that takes each one.
The arguments after pulse_delay are :func:chopcal.bifrost's. pulse_delay is
the BeamPosDly-S the chopper controllers hold, in ns as they hold it; it has
no default because no value is right for every installation.
pulse_shaping_speed_max is the fastest the installed pulse shaping disks may
turn, which NICOS knows as the largest speed its psc1_chopper_speed device
maps. Each disc gets its
<disc>_chopper_speed in Hz, signed as Spd_S is, positive clockwise facing
away from the source (bwc2 counter-rotates), and its
<disc>_chopper_delay, the experiment delay ChopDly-S, in ns::
>>> bifrost(pulse_delay=10_000, energy_min=7.0) # doctest: +SKIP
{'psc1_chopper_speed': -196.0, 'psc1_chopper_delay': ..., ...}
This takes chopcal's timing reference, the proton pulse, to be the one the choppers and the detectors are timed from (NiSync).
experiment_delay
¶
ESS ChopDly-S for one chopper, in seconds, in [0, 1/|speed|).
pulse_delay is the instrument's BeamPosDly-S, in seconds. A disc point at
angle a is on the beam at delay + (beam - a) / (360 speed), as chopper-lib
defines it; the time wanted is when the centre of the opening is, and the openings
recur every turn, so the result is folded into one turn of the disc. A disc that is
not turning has no delay; zero stands in for it.
Only a disc of one opening has a reference opening that does not depend on where its top-dead-centre mark is, which chopcal does not know; any other is refused.