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
D&E Collaboration Projects
dintef
Commits
4bb162be
Commit
4bb162be
authored
Jun 07, 2022
by
Marin Collonge
Browse files
DAQ: get_synced_data_stages function added with coarse and fine stages data split
parent
abddd5e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/clients/sus/daq/daq.py
View file @
4bb162be
...
...
@@ -280,6 +280,28 @@ class daq():
synced_data
[
i
]
=
8
*
coarse
+
fine
return
synced_data
def
get_synced_data_stages
(
self
,
channel
=
0
,
words_per_FE
=
3750
):
synced_data_bytewise
=
self
.
get_synced_data_bytewise
(
channel
,
words_per_FE
+
1
)
if
(
self
.
bytes_per_fe
==
2
):
high_byte
=
synced_data_bytewise
[
0
:
self
.
bytes_per_fe
*
self
.
NB_FES
*
words_per_FE
:
2
]
low_byte
=
synced_data_bytewise
[
1
::
2
]
high_byte_mask_coarse
=
0b00001111
low_byte_mask_coarse
=
0b11000000
low_byte_mask_fine
=
0b00111111
coarse_data
=
np
.
zeros
(
len
(
high_byte
))
fine_data
=
np
.
zeros
(
len
(
high_byte
))
for
i
in
np
.
arange
(
len
(
high_byte
)):
low_byte_coarse
=
(
int
(
low_byte
[
i
])
&
low_byte_mask_coarse
)
>>
6
high_byte_coarse
=
(
int
(
high_byte
[
i
])
&
high_byte_mask_coarse
)
<<
2
coarse
=
high_byte_coarse
+
low_byte_coarse
low_byte_fine
=
int
(
low_byte
[
i
+
self
.
NB_FES
])
&
low_byte_mask_fine
fine
=
low_byte_fine
coarse_data
[
i
]
=
coarse
fine_data
[
i
]
=
fine
return
coarse_data
,
fine_data
def
calcAvgsForAllFEs
(
self
,
data
):
...
...
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