Skip to content

Commit 3c5857a

Browse files
authored
Merge pull request #417 from European-XFEL/feat/manual-pulses
Add pulse selection machinery and manual pulse patterns
2 parents 5844aa5 + a89086f commit 3c5857a

5 files changed

Lines changed: 633 additions & 30 deletions

File tree

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Added:
2828
find the constants suitable for a given `DataCollection`
2929
- [DetectorData][extra.calibration.DetectorData] to obtain detector metadata and
3030
module mapping from the Calibration Cataloge (!408).
31+
- [PulsePattern.select_pulses][extra.components.pulses.PulsePattern.select_pulses],
32+
[PulsePattern.deselect_pulses][extra.components.pulses.PulsePattern.deselect_pulses] and
33+
[PulsePattern.union][extra.components.pulses.PulsePattern.union] to modify pulse patterns (!417).
34+
- [ManualPulses][extra.components.ManualPulses] to generate custom pulse pattern with
35+
the same interface as existing
36+
[PulsePattern][extra.components.pulses.PulsePattern]-based components (!417).
3137
- [SpectrometerCalibration][extra.gui.jupyter.SpectrometerCalibration] to
3238
provide a Jupyter widget for energy calibration of 2D X-ray spectrum data
3339
(!363).

docs/components/pulse-patterns.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,95 @@
1+
2+
Analog to European XFEL's timing structure, its data is also organized in trains
3+
identifed by a unique and global train ID. Some data however, in particular many
4+
of the primary detectors in an experiment like AGIPD, DSSC, LPD or fast digitizers,
5+
also resolves every or at least some of the underlying pulses a train is composed of.
6+
7+
![European XFEL timing structure](../images/trains_pulses.png){ width="75%" align=center }
8+
9+
The `PulsePattern` family of components allows access to pulse patterns recorded
10+
by various sources. For example, in order to obtain the FEL pulses for a particular
11+
SASE:
12+
13+
```python
14+
p = XrayPulses(run)
15+
p.pulse_ids()
16+
```
17+
18+
There are different types available depending on the source that should be used for
19+
the pulse pattern information, but they all offer the same interface as
20+
[`PulsePattern`][extra.components.pulses.PulsePattern] for access. Furthermore,
21+
many other components like [`AdqRawChannel`][extra.components.AdqRawChannel] can be
22+
given a [`PulsePattern`][extra.components.pulses.PulsePattern] component to customize
23+
how pulse-resolved data is interpreted.
24+
25+
The primary source of pulse pattern information is the bunch pattern table from
26+
the machine side, which is recorded either through a so called timeserver or a
27+
pulse pattern decoder source. There are three different components available to access
28+
different parts of this data:
29+
30+
- [`XrayPulses`][extra.components.XrayPulses] for FEL pulses.
31+
- [`OpticalLaserPulses`][extra.components.OpticalLaserPulses] for optical laser
32+
or PPL pulses.
33+
- [`MachinePulses`][extra.components.MachinePulses] for machine-related pulses
34+
or any other data in the bunch pattern table.
35+
36+
There is a special component available for pump-probe experiments, which can combine
37+
FEL and PPL pulses into a single pattern with corresponding labels which of these two
38+
is present in a given pulse:
39+
40+
- [`PumpProbePulses`][extra.components.PumpProbePulses] for combined FEL/PPL
41+
pulse patterns.
42+
43+
All of the components above offer the interface of
44+
[`TimeserverPulses`][extra.components.pulses.TimeserverPulses] in addition to the
45+
general interface of [`PulsePattern`][extra.components.pulses.PulsePattern].
46+
47+
Apart from that, there are components to access other sources of pulse pattern
48+
information via the same [`PulsePattern`][extra.components.pulses.PulsePattern]
49+
interface:
50+
51+
- [`ManualPulses`][extra.components.ManualPulses] for manually created pulse
52+
pattern or modifications of existing patterns via
53+
[`select_pulses()`][extra.components.pulses.PulsePattern.select_pulses],
54+
[`deselect_pulses()`][extra.components.pulses.PulsePattern.select_pulses] or
55+
[`union()`][extra.components.pulses.PulsePattern.union].
56+
57+
- [`DldPulses`][extra.components.DldPulses] for pulse informations generated as
58+
part of processed DLD (delay line detector) data.
59+
60+
As opposed to trains, there is no single global mechanism how to record pulses and
61+
some sources use their own identification scheme. Therefore, these components aim to
62+
refer to the location of pulses in the machine bunch pattern table wherever possible
63+
as a shared and universal identification called *pulse ID*. An enumeration of pulses
64+
for a single SASE, instrument or device is called *pulse index*. If desired, the
65+
*pulse time* uses the relative time to the beginning of a subtrain.
66+
67+
::: extra.components.pulses.PulsePattern
68+
69+
::: extra.components.pulses.TimeserverPulses
70+
options:
71+
inherited_members: no
72+
173
::: extra.components.XrayPulses
74+
options:
75+
inherited_members: no
276

377
::: extra.components.OpticalLaserPulses
78+
options:
79+
inherited_members: no
480

581
::: extra.components.PumpProbePulses
82+
options:
83+
inherited_members: no
684

785
::: extra.components.MachinePulses
86+
options:
87+
inherited_members: no
88+
89+
::: extra.components.ManualPulses
90+
options:
91+
inherited_members: false
892

993
::: extra.components.DldPulses
94+
options:
95+
inherited_members: false

src/extra/components/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
from .scantool import Scantool # noqa
33
from .pulses import XrayPulses, OpticalLaserPulses, MachinePulses, \
4-
PumpProbePulses, DldPulses # noqa
4+
PumpProbePulses, ManualPulses, DldPulses # noqa
55
from .scan import Scan # noqa
66
from .xgm import XGM # noqa
77
from .dld import DelayLineDetector # noqa

0 commit comments

Comments
 (0)