Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pulse_lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech QDLabs
pulse_lib
Commits
5c3c59b8
Commit
5c3c59b8
authored
1 year ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Fixed channel numbering
parent
29ef44f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pulse_lib/tektronix/m4i_controller.py
+3
-3
3 additions, 3 deletions
pulse_lib/tektronix/m4i_controller.py
with
3 additions
and
3 deletions
pulse_lib/tektronix/m4i_controller.py
+
3
−
3
View file @
5c3c59b8
...
...
@@ -59,7 +59,7 @@ class M4iControl:
self
.
_channels
=
channels
if
len
(
channels
)
==
3
:
self
.
_enabled_channels
=
[
1
,
2
,
3
,
4
]
self
.
_enabled_channels
=
[
0
,
1
,
2
,
3
]
else
:
self
.
_enabled_channels
=
channels
self
.
_num_ch
=
len
(
self
.
_enabled_channels
)
...
...
@@ -120,7 +120,7 @@ class M4iControl:
# filter channels
if
len
(
self
.
_channels
)
==
3
:
selection
=
[
ch
-
1
for
ch
in
self
.
_channels
]
selection
=
list
(
self
.
_channels
)
data
=
data
[
selection
]
# aggregate samples (down-sampling / time average)
...
...
@@ -130,7 +130,7 @@ class M4iControl:
step
=
self
.
_eff_sample_rate
/
self
.
_data_sample_rate
boundaries
=
np
.
floor
(
np
.
arange
(
0
,
self
.
_samples_per_segment
,
step
)
+
0.5
).
astype
(
int
)
if
self
.
_samples_per_segment
-
boundaries
[
-
1
]
>
0.8
*
step
:
boundaries
=
np
.
concatenate
([
boundaries
,
[
-
1
]])
boundaries
=
np
.
concatenate
([
boundaries
,
[
self
.
_samples_per_segment
]])
res
=
np
.
empty
(
data
.
shape
[:
-
1
]
+
(
len
(
boundaries
)
-
1
,))
for
i
in
range
(
len
(
boundaries
)
-
1
):
res
[...,
i
]
=
np
.
mean
(
data
[...,
boundaries
[
i
]:
boundaries
[
i
+
1
]],
axis
=-
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment