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
61af86d8
Commit
61af86d8
authored
3 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Add waveform with low sample rate for long DC compensation time.
parent
0cedcc5f
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/keysight/M3202A_uploader.py
+21
-4
21 additions, 4 deletions
pulse_lib/keysight/M3202A_uploader.py
with
21 additions
and
4 deletions
pulse_lib/keysight/M3202A_uploader.py
+
21
−
4
View file @
61af86d8
...
...
@@ -524,6 +524,24 @@ class UploadAggregator:
compensation_time
=
self
.
get_max_compensation_time
()
logging
.
debug
(
f
'
DC compensation time:
{
compensation_time
*
1e9
}
ns
'
)
compensation_npt
=
int
(
np
.
ceil
(
compensation_time
*
section
.
sample_rate
*
1e9
))
if
compensation_npt
>
50_000
:
# more than 50_000 samples? Use new segment with lower sample rate for compensation
sample_rate
=
1e9
*
section
.
sample_rate
*
5_000
/
compensation_npt
# find an existing sample rate
nice_sample_rates
=
[
1e6
,
2e6
,
5e6
,
1e7
,
2e7
,
5e7
,
1e8
,
2e8
,
1e9
]
for
sr
in
nice_sample_rates
:
if
sample_rate
<=
sr
:
sample_rate
=
sr
*
1e-9
break
# create new section
section
.
align
(
extend
=
True
)
section
=
RenderSection
(
sample_rate
,
section
.
t_end
)
sections
.
append
(
section
)
# calculate npt
compensation_npt
=
int
(
np
.
ceil
(
compensation_time
*
section
.
sample_rate
*
1e9
))
logging
.
info
(
f
'
Added new segment for DC compensation:
{
int
(
compensation_time
*
1e9
)
}
ns,
'
f
'
sample_rate:
{
sr
/
1e6
}
MHz,
{
compensation_npt
}
Sa
'
)
job
.
upload_info
.
dc_compensation_duration
=
compensation_npt
/
section
.
sample_rate
section
.
npt
+=
compensation_npt
...
...
@@ -643,25 +661,24 @@ class UploadAggregator:
if
job
.
neutralize
:
if
section
!=
sections
[
-
1
]:
#
Corner case,
DC compensation is in a
new section # @@@ can this occur??
# DC compensation is in a
separate section
bias_T_compensation_mV
=
self
.
_add_bias_T_compensation
(
buffer
,
bias_T_compensation_mV
,
section
.
sample_rate
,
channel_info
)
self
.
_upload_wvf
(
job
,
channel_name
,
buffer
,
channel_info
.
amplitude
,
channel_info
.
attenuation
,
section
.
sample_rate
,
awg_upload_func
)
section
=
sections
[
-
1
]
buffer
=
np
.
zeros
(
section
.
npt
)
logging
.
info
(
f
'
DC compensation
: Corner case
{
section
}
'
)
logging
.
info
(
f
'
DC compensation
section with
{
section
.
npt
}
Sa
'
)
compensation_npt
=
round
(
job
.
upload_info
.
dc_compensation_duration
*
section
.
sample_rate
)
if
compensation_npt
>
0
and
channel_info
.
dc_compensation
:
compensation_voltage
=
-
channel_info
.
integral
*
sample_rate
/
compensation_npt
*
1e9
compensation_voltage
=
-
channel_info
.
integral
*
section
.
sample_rate
/
compensation_npt
*
1e9
job
.
upload_info
.
dc_compensation_voltages
[
channel_name
]
=
compensation_voltage
buffer
[
-
(
compensation_npt
+
1
):
-
1
]
=
compensation_voltage
logging
.
debug
(
f
'
DC compensation
{
channel_name
}
:
{
compensation_voltage
:
6.1
f
}
mV
{
compensation_npt
}
Sa
'
)
else
:
job
.
upload_info
.
dc_compensation_voltages
[
channel_name
]
=
0
# TODO: @@@ reduce length of waveform?
bias_T_compensation_mV
=
self
.
_add_bias_T_compensation
(
buffer
,
bias_T_compensation_mV
,
section
.
sample_rate
,
channel_info
)
...
...
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