From 8f95af51df76c0f9fa551b2fe827d980d8c8f71a Mon Sep 17 00:00:00 2001 From: TheoLaudatQM <98808790+TheoLaudatQM@users.noreply.github.com> Date: Tue, 26 Jul 2022 14:19:20 +0200 Subject: [PATCH] Update calibration with new is_processing (#130) * Update with new is_processing * black --- .../addons/calibration/calibrations.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/qualang_tools/addons/calibration/calibrations.py b/qualang_tools/addons/calibration/calibrations.py index f71170eb..a347b03a 100644 --- a/qualang_tools/addons/calibration/calibrations.py +++ b/qualang_tools/addons/calibration/calibrations.py @@ -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( @@ -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( @@ -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(