Skip to content

Commit

Permalink
small fix that ensured convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
msamiotis committed May 4, 2024
1 parent 0bc5ee4 commit 80d4dbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pycqed/analysis_v2/cryoscope_v2_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ def process_data(self):
Trace = Trace[initial_idx:]
# Fit exponential to trace
from scipy.optimize import curve_fit
p0 = [-.2, 15e-9, 1]
popt, pcov = curve_fit(filter_func, Times, Trace, p0=p0)
p0 = [-.2, 15e-9, 1.02] # third point changed from 1 to 1.02
popt, pcov = curve_fit(filter_func, Times, Trace, p0=p0, maxfev=5000)
filtr = {'amp': popt[0], 'tau': popt[1]}
self.proc_data_dict['exponential_filter'][q] = filtr
self.proc_data_dict['fit_params'][q] = popt
Expand Down Expand Up @@ -1110,7 +1110,7 @@ def process_data(self):
_Amps = np.array(list(Amps)+[0])
_Freqs = np.array(list(Freqs)+[0])
# RDC 26/10/2023. deg was 2, I am changing it to 4 to improve the freq conversion
P_coefs = np.polyfit(_Amps, _Freqs, deg=4)
P_coefs = np.polyfit(_Amps, _Freqs, deg=2)
# Save processed data
self.proc_data_dict['Amps'] = Amps
self.proc_data_dict['Freqs'] = Freqs
Expand Down

0 comments on commit 80d4dbf

Please sign in to comment.