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
b91ecba8
Commit
b91ecba8
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Fixed plotting after mk_sequence.
Fixed add_HVI_marker with loop_obj.
parent
a2140c46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pulse_lib/segments/segment_base.py
+17
-4
17 additions, 4 deletions
pulse_lib/segments/segment_base.py
pulse_lib/segments/segment_container.py
+25
-7
25 additions, 7 deletions
pulse_lib/segments/segment_container.py
with
42 additions
and
11 deletions
pulse_lib/segments/segment_base.py
+
17
−
4
View file @
b91ecba8
...
@@ -234,10 +234,23 @@ class segment_base():
...
@@ -234,10 +234,23 @@ class segment_base():
marker_name (str) : name of the marker to add
marker_name (str) : name of the marker to add
t_off (str) : offset to be given from the marker
t_off (str) : offset to be given from the marker
'''
'''
times
=
loop_obj
(
no_setpoints
=
True
)
start_time
=
self
.
start_time
times
.
add_data
(
self
.
data
.
start_time
,
axis
=
list
(
range
(
self
.
data
.
ndim
-
1
,
-
1
,
-
1
)))
if
start_time
.
shape
!=
(
1
,):
setpoint_data
=
self
.
setpoints
time_shape
=
[]
for
i
in
range
(
start_time
.
ndim
):
s
=
start_time
.
shape
[
i
]
if
s
>
1
:
time_shape
.
append
(
s
)
start_time
=
start_time
.
reshape
(
time_shape
)
times
=
loop_obj
()
times
.
add_data
(
start_time
,
labels
=
setpoint_data
.
labels
,
units
=
setpoint_data
.
units
,
axis
=
setpoint_data
.
axis
,
setvals
=
setpoint_data
.
setpoints
)
time
=
t_off
+
times
else
:
time
=
t_off
+
start_time
[
0
]
self
.
add_HVI_variable
(
marker_name
,
time
s
+
t_off
,
True
)
self
.
add_HVI_variable
(
marker_name
,
time
,
True
)
def
add_HVI_variable
(
self
,
marker_name
,
value
,
time
=
False
):
def
add_HVI_variable
(
self
,
marker_name
,
value
,
time
=
False
):
"""
"""
...
@@ -407,7 +420,7 @@ class segment_base():
...
@@ -407,7 +420,7 @@ class segment_base():
if
render_full
==
True
:
if
render_full
==
True
:
pulse_data_curr_seg
=
self
.
_get_data_all_at
(
index
)
pulse_data_curr_seg
=
self
.
_get_data_all_at
(
index
)
else
:
else
:
pulse_data_curr_seg
=
self
.
data
[
map_index
(
index
,
self
.
shape
)]
pulse_data_curr_seg
=
self
.
data
[
map_index
(
index
,
self
.
data
.
shape
)]
line
=
'
-
'
if
self
.
type
==
'
render
'
else
'
:
'
line
=
'
-
'
if
self
.
type
==
'
render
'
else
'
:
'
y
=
pulse_data_curr_seg
.
render
(
sample_rate
)
y
=
pulse_data_curr_seg
.
render
(
sample_rate
)
...
...
This diff is collapsed.
Click to expand it.
pulse_lib/segments/segment_container.py
+
25
−
7
View file @
b91ecba8
...
@@ -437,11 +437,27 @@ class segment_container():
...
@@ -437,11 +437,27 @@ class segment_container():
marker_name (str) : name of the marker to add
marker_name (str) : name of the marker to add
t_off (str) : offset to be given from the marker
t_off (str) : offset to be given from the marker
'''
'''
times
=
lp
.
loop_obj
(
no_setpoints
=
True
)
start_time
=
self
.
_start_time
# Look into this inversion of the setpoints
if
start_time
.
shape
!=
(
1
,):
times
.
add_data
(
self
.
_start_time
,
axis
=
list
(
range
(
self
.
ndim
-
1
,
-
1
,
-
1
)))
setpoint_data
=
self
.
setpoint_data
time_shape
=
[]
for
i
in
range
(
start_time
.
ndim
):
s
=
start_time
.
shape
[
i
]
if
s
>
1
:
time_shape
.
append
(
s
)
start_time
=
start_time
.
reshape
(
time_shape
)
times
=
lp
.
loop_obj
()
times
.
add_data
(
start_time
,
labels
=
setpoint_data
.
labels
,
units
=
setpoint_data
.
units
,
axis
=
setpoint_data
.
axis
,
setvals
=
setpoint_data
.
setpoints
)
time
=
t_off
+
times
else
:
time
=
t_off
+
start_time
[
0
]
# print('start', type(start_time), start_time)
# print('t_off', t_off)
# print('time', time)
self
.
add_HVI_variable
(
marker_name
,
time
s
+
t_off
,
True
)
self
.
add_HVI_variable
(
marker_name
,
time
,
True
)
def
add_HVI_variable
(
self
,
marker_name
,
value
,
time
=
False
):
def
add_HVI_variable
(
self
,
marker_name
,
value
,
time
=
False
):
"""
"""
...
@@ -510,11 +526,13 @@ class segment_container():
...
@@ -510,11 +526,13 @@ class segment_container():
if
render_full
:
if
render_full
:
if
channels
is
None
:
if
channels
is
None
:
channels
=
[
name
for
name
in
self
.
channels
if
self
[
name
].
type
==
'
render
'
]
channels
=
[
name
for
name
in
self
.
channels
if
self
[
name
].
type
==
'
render
'
]
self
.
enter_rendering_mode
()
render_mode
=
self
.
render_mode
if
not
render_mode
:
self
.
enter_rendering_mode
()
for
channel_name
in
channels
:
for
channel_name
in
channels
:
self
[
channel_name
].
plot_segment
(
index
,
sample_rate
=
sample_rate
,
render_full
=
render_full
)
self
[
channel_name
].
plot_segment
(
index
,
sample_rate
=
sample_rate
,
render_full
=
render_full
)
self
.
exit_
render
ing
_mode
()
if
not
render_mode
:
self
.
exit_rendering_mode
()
else
:
else
:
if
channels
is
None
:
if
channels
is
None
:
channels
=
self
.
channels
channels
=
self
.
channels
...
...
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