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
74c2c830
Commit
74c2c830
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Added channels to sequencer.plot. Added units to sequencer sweep parameters
parent
59d55f5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pulse_lib/sequencer.py
+12
-5
12 additions, 5 deletions
pulse_lib/sequencer.py
with
12 additions
and
5 deletions
pulse_lib/sequencer.py
+
12
−
5
View file @
74c2c830
...
...
@@ -231,7 +231,8 @@ class sequencer():
for
i
in
range
(
len
(
self
.
labels
)):
par_name
=
self
.
labels
[
i
].
replace
(
'
'
,
'
_
'
)
set_param
=
index_param
(
par_name
,
self
,
dim
=
i
)
set_param
=
index_param
(
par_name
,
self
.
labels
[
i
],
self
.
units
[
i
],
self
,
dim
=
i
)
self
.
params
.
append
(
set_param
)
setattr
(
self
,
par_name
,
set_param
)
...
...
@@ -542,13 +543,14 @@ class sequencer():
self
.
upload
(
index
)
def
plot
(
self
,
index
=
None
,
segments
=
None
,
awg_output
=
True
):
def
plot
(
self
,
index
=
None
,
segments
=
None
,
awg_output
=
True
,
channels
=
None
):
'''
Plot sequence for specified index and segments.
Args:
index (tuple): index in sequence. If None use last index set via sweep params.
segments (list[int]): indices of segments to plot. If None, plot all.
awg_output (bool): if True plot output of AWGs, else plot virtual data.
channels (list[str]): names of channels to plot, if None, plot all.
'''
if
index
is
None
:
index
=
self
.
sweep_index
[::
-
1
]
...
...
@@ -558,7 +560,7 @@ class sequencer():
for
s
in
segments
:
pt
.
figure
()
pt
.
title
(
f
'
Segment
{
s
}
index:
{
index
}
'
)
self
.
sequence
[
s
].
plot
(
index
,
render_full
=
awg_output
)
self
.
sequence
[
s
].
plot
(
index
,
channels
=
channels
,
render_full
=
awg_output
)
def
get_measurement_results
(
self
,
index
=
None
,
raw
=
True
,
states
=
True
,
values
=
True
,
...
...
@@ -721,12 +723,17 @@ class sequencer():
raise
IndexError
(
f
'
Index
{
index
}
out of range; sequence shape
{
self
.
_shape
}
'
)
class
index_param
(
Parameter
):
def
__init__
(
self
,
name
,
my_seq
,
dim
):
def
__init__
(
self
,
name
,
label
,
unit
,
my_seq
,
dim
):
self
.
my_seq
=
my_seq
self
.
dim
=
dim
self
.
values
=
my_seq
.
setpoints
[
dim
]
val_map
=
dict
(
zip
(
self
.
values
,
range
(
len
(
self
.
values
))))
super
().
__init__
(
name
=
name
,
val_mapping
=
val_map
,
initial_value
=
self
.
values
[
0
])
super
().
__init__
(
name
=
name
,
label
=
label
,
unit
=
unit
,
val_mapping
=
val_map
,
initial_value
=
self
.
values
[
0
])
def
set_raw
(
self
,
value
):
self
.
my_seq
.
set_sweep_index
(
self
.
dim
,
value
)
...
...
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