Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maximilian Schuette
MCS DAQ Data Tools
Commits
1b1d25ee
Commit
1b1d25ee
authored
Nov 27, 2020
by
Maximilian Schuette
🌃
Browse files
Renamed parse_timing_pattern_packed to unpack_timing_pattern
parent
66c5f085
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/mcsdaqtools/DaqTimingPattern.py
View file @
1b1d25ee
...
...
@@ -7,7 +7,7 @@
# from mcxdaqtools.DaqTimingPatter import parse_timing_pattern_packed
#
# with h5py.File('sample.hdf5', 'r') as file:
# bunch_pattern =
parse
_timing_pattern
_packed
(file['XFEL.DIAG/TIMINGINFO/TIME1.BUNCH_PATTERN/Value'][0])
# bunch_pattern =
unpack
_timing_pattern(file['XFEL.DIAG/TIMINGINFO/TIME1.BUNCH_PATTERN/Value'][0])
# plt.figure()
# plt.plot(bunch_pattern.destination[::4])
# plt.yticks([e.value for e in DestinationXfel], [e.name for e in DestinationXfel])
...
...
@@ -147,7 +147,7 @@ timing_pattern_type = {linac: np.dtype([('bunch_charge_setting', BunchChargeSett
(
'special_flags'
,
SpecialFlags
[
linac
])])
for
linac
in
LINACS
}
def
parse
_timing_pattern
_packed
(
value
,
linac
=
LINACS
[
0
]):
def
unpack
_timing_pattern
(
value
,
linac
=
LINACS
[
0
]):
if
not
isinstance
(
linac
,
str
)
or
linac
.
lower
()
not
in
LINACS
:
raise
TypeError
(
f
"`mode` must be either of
{
LINACS
}
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment