Skip to content

Commit

Permalink
Update calibration with new is_processing (qua-platform#130)
Browse files Browse the repository at this point in the history
* Update with new is_processing
* black
  • Loading branch information
TheoLaudatQM authored Jul 26, 2022
1 parent 2e1a8b8 commit 8f95af5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions qualang_tools/addons/calibration/calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,16 @@ def _get_IQ_data_and_plot(self, job, calib, plot, dim):
interrupt_on_close(
fig, job
) # Interrupts the job when closing the figure
while res_handles.is_processing():
while results.is_processing():
I, Q, iteration = results.fetch_all()
I = u.demod2volts(I, self.config["pulses"][pulse]["length"])
Q = u.demod2volts(Q, self.config["pulses"][pulse]["length"])

progress_counter(iteration, self.scan_var[calib]["averaging"])
progress_counter(
iteration,
self.scan_var[calib]["averaging"],
start_time=results.get_start_time(),
)

self.results[calib]["amplitude"] = np.sqrt(I**2 + Q**2)
self.results[calib]["phase"] = signal.detrend(
Expand All @@ -295,8 +299,7 @@ def _get_IQ_data_and_plot(self, job, calib, plot, dim):
title=calib,
)
plt.pause(0.01)
if len(self.results[calib]["amplitude"]) == 0:
print("Warning: the execution id too short for live plotting.")

else:
res_handles.wait_for_all_values()
I = u.demod2volts(
Expand Down Expand Up @@ -334,12 +337,16 @@ def _get_IQ_data_and_plot(self, job, calib, plot, dim):
interrupt_on_close(
fig, job
) # Interrupts the job when closing the figure
while res_handles.is_processing():
while results.is_processing():
I, Q, iteration = results.fetch_all()
I = u.demod2volts(I, self.config["pulses"][pulse]["length"])
Q = u.demod2volts(Q, self.config["pulses"][pulse]["length"])

progress_counter(iteration, self.scan_var[calib]["averaging"])
progress_counter(
iteration,
self.scan_var[calib]["averaging"],
start_time=results.get_start_time(),
)

self.results[calib]["amplitude"] = np.sqrt(I**2 + Q**2)
self.results[calib]["phase"] = signal.detrend(
Expand Down

0 comments on commit 8f95af5

Please sign in to comment.