Skip to content
Snippets Groups Projects
Commit 0f878d52 authored by Sander de Snoo's avatar Sander de Snoo
Browse files

Added checks on limits

parent dba20834
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,12 @@ def read_channels(pulselib, t_measure, channels=None, sample_rate=None, iq_mode= ...@@ -37,6 +37,12 @@ def read_channels(pulselib, t_measure, channels=None, sample_rate=None, iq_mode=
and sample_rate is not None and sample_rate is not None
and t_measure*1e-9*sample_rate > 2e6): and t_measure*1e-9*sample_rate > 2e6):
raise Exception(f"Too many samples for Keysight_QS ({int(t_measure*1e-9*sample_rate)} > 2e6)") raise Exception(f"Too many samples for Keysight_QS ({int(t_measure*1e-9*sample_rate)} > 2e6)")
if sample_rate is not None and sample_rate < 1000:
factor = 1000/sample_rate
max_output = 0.25 / factor
print(f"Warning: sample rate of {sample_rate} Sa/s is {factor:.1f} times the safe limit. "
f"Numerical overflow could occur. Check if all measured data is < {max_output:.2%} of configured "
"digitizer input range.")
# set sample rate for Keysight upload. # set sample rate for Keysight upload.
if t_measure > 20_000_000: if t_measure > 20_000_000:
awg_sample_rate = 1e5 awg_sample_rate = 1e5
...@@ -51,9 +57,11 @@ def read_channels(pulselib, t_measure, channels=None, sample_rate=None, iq_mode= ...@@ -51,9 +57,11 @@ def read_channels(pulselib, t_measure, channels=None, sample_rate=None, iq_mode=
else: else:
# let the driver set the sample rate. # let the driver set the sample rate.
awg_sample_rate = None awg_sample_rate = None
if pulselib._backend == "Qblox":
if t_measure > 2.1e9: if (pulselib._backend == "Qblox"
raise Exception("Qblox backend implementation does not support t_measure > 2.1 s") and sample_rate is not None
and t_measure*1e-9*sample_rate > 130_000):
raise Exception(f"Too many samples for Qblox QRM ({int(t_measure*1e-9*sample_rate)} > 130_000)")
if channels is None: if channels is None:
channels = pulselib.digitizer_channels.keys() channels = pulselib.digitizer_channels.keys()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment