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
b9472f3a
Commit
b9472f3a
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Fixed add_derived_param with time-trace averaged over repetitions
parent
dc006889
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/acquisition/measurement_converter.py
+38
-36
38 additions, 36 deletions
pulse_lib/acquisition/measurement_converter.py
with
38 additions
and
36 deletions
pulse_lib/acquisition/measurement_converter.py
+
38
−
36
View file @
b9472f3a
...
...
@@ -49,12 +49,12 @@ class DataSelection:
class
MeasurementParameter
(
MultiParameter
):
def
__init__
(
self
,
name
,
source
,
mc
,
data_
filter
):
setpoints
=
mc
.
get_setpoints
(
data_
filter
)
def
__init__
(
self
,
name
,
source
,
mc
,
data_
selection
):
setpoints
=
mc
.
get_setpoints
(
data_
selection
)
super
().
__init__
(
name
,
**
setpoints
.
__dict__
)
self
.
_source
=
source
self
.
_mc
=
mc
self
.
_data_
filter
=
data_filter
self
.
_data_
selection
=
data_selection
self
.
_derived_params
=
{}
def
add_derived_param
(
self
,
name
,
func
,
label
=
None
,
unit
=
'
mV
'
,
...
...
@@ -129,7 +129,10 @@ class MeasurementParameter(MultiParameter):
time
=
tuple
(
np
.
arange
(
n_samples
)
*
period
)
sp_names
+=
(
'
time
'
,)
sp_units
+=
(
'
ns
'
,)
setpoints
+=
((
time
,)
*
n_rep
,)
if
add_repetitions
:
setpoints
+=
((
time
,)
*
n_rep
,)
else
:
setpoints
+=
(
time
,)
sp_labels
=
sp_names
self
.
setpoints
=
self
.
setpoints
+
(
setpoints
,)
...
...
@@ -150,7 +153,7 @@ class MeasurementParameter(MultiParameter):
data
=
self
.
_source
.
get_channel_data
()
self
.
_mc
.
set_channel_data
(
data
)
data
=
self
.
_mc
.
get_measurement_data
(
self
.
_data_
filter
)
data
=
self
.
_mc
.
get_measurement_data
(
self
.
_data_
selection
)
if
len
(
self
.
_derived_params
)
>
0
:
data_map
=
{
name
:
values
for
name
,
values
in
zip
(
self
.
names
,
data
)}
...
...
@@ -187,42 +190,41 @@ class MeasurementConverter:
self
.
_generate_setpoints_raw
()
self
.
_generate_setpoints
()
# @@@ add raw average over periods.
def
_generate_setpoints_raw
(
self
):
n_rep
=
self
.
n_rep
digitizer_channels
=
self
.
_description
.
digitizer_channels
for
m
in
self
.
_description
.
measurements
:
if
isinstance
(
m
,
measurement_acquisition
):
sp_names
=
(
'
repetition
'
,)
sp_units
=
(
''
,)
shape
=
(
n_rep
,)
setpoints
=
(
tuple
(
np
.
arange
(
n_rep
)),)
if
m
.
n_samples
is
not
None
:
period
=
1e9
/
self
.
_sample_rate
time
=
tuple
(
np
.
arange
(
m
.
n_samples
)
*
period
)
shape
+=
(
m
.
n_samples
,)
sp_names
+=
(
'
time
'
,)
sp_units
+=
(
'
ns
'
,)
setpoints
+=
((
time
,)
*
n_rep
,)
channel_name
=
m
.
acquisition_channel
channel
=
digitizer_channels
[
channel_name
]
name
=
f
'
{
m
.
name
}
'
label
=
f
'
{
m
.
name
}
(
{
channel_name
}
:
{
m
.
index
}
)
'
sp_raw
=
SetpointsSingle
(
name
,
label
,
'
mV
'
,
shape
,
setpoints
,
sp_names
,
sp_names
,
sp_units
)
self
.
sp_raw
.
append
(
sp_raw
)
if
channel
.
iq_out
:
for
suffix
in
[
'
_I
'
,
'
_Q
'
]:
name
=
f
'
{
m
.
name
}{
suffix
}
'
label
=
f
'
{
m
.
name
}{
suffix
}
(
{
channel_name
}{
suffix
}
:
{
m
.
index
}
)
'
sp_raw
=
SetpointsSingle
(
name
,
label
,
'
mV
'
,
shape
,
setpoints
,
sp_names
,
sp_names
,
sp_units
)
self
.
sp_raw_split
.
append
(
sp_raw
)
else
:
if
not
isinstance
(
m
,
measurement_acquisition
):
continue
sp_names
=
(
'
repetition
'
,)
sp_units
=
(
''
,)
shape
=
(
n_rep
,)
setpoints
=
(
tuple
(
np
.
arange
(
n_rep
)),)
if
m
.
n_samples
is
not
None
:
period
=
1e9
/
self
.
_sample_rate
time
=
tuple
(
np
.
arange
(
m
.
n_samples
)
*
period
)
shape
+=
(
len
(
time
),)
sp_names
+=
(
'
time
'
,)
sp_units
+=
(
'
ns
'
,)
setpoints
+=
((
time
,)
*
n_rep
,)
channel_name
=
m
.
acquisition_channel
channel
=
digitizer_channels
[
channel_name
]
name
=
f
'
{
m
.
name
}
'
label
=
f
'
{
m
.
name
}
(
{
channel_name
}
:
{
m
.
index
}
)
'
sp_raw
=
SetpointsSingle
(
name
,
label
,
'
mV
'
,
shape
,
setpoints
,
sp_names
,
sp_names
,
sp_units
)
self
.
sp_raw
.
append
(
sp_raw
)
if
channel
.
iq_out
:
for
suffix
in
[
'
_I
'
,
'
_Q
'
]:
name
=
f
'
{
m
.
name
}{
suffix
}
'
label
=
f
'
{
m
.
name
}{
suffix
}
(
{
channel_name
}{
suffix
}
:
{
m
.
index
}
)
'
sp_raw
=
SetpointsSingle
(
name
,
label
,
'
mV
'
,
shape
,
setpoints
,
sp_names
,
sp_names
,
sp_units
)
self
.
sp_raw_split
.
append
(
sp_raw
)
else
:
self
.
sp_raw_split
.
append
(
sp_raw
)
def
_generate_setpoints
(
self
):
...
...
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