Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent change to resonator analysis class breaks circle fit in 2D Measurements. #108

Open
thilokru opened this issue May 31, 2023 · 5 comments

Comments

@thilokru
Copy link
Collaborator

See comment c93b1c6#r115820757 .
Setting i=1 at the beginning of the loop fixes the problem, but this an ugly hack.

@Schneider1

@paoloaq
Copy link

paoloaq commented Nov 23, 2024

Hi @thilokru,

I am trying to use Qkit to perform a fit. However, after applying the changes from commit c93b1c6#r115820757, I am encountering the following exception when calling the fit_circle method of Resonator:

Resonator' object has no attribute '_circ_amp_gen'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[26], line 6
      2 res = Resonator(h5d.get_filepath())
      4 #res.fit_lorentzian(fit_all=True,f_min=5.667e9,f_max=5.668e9)
      5 #res.fit_fano(fit_all=True)
----> 6 res.fit_circle(fit_all=True,f_max=5.668e9)
      9 '''
     10 res.set_x_coord(s33_data[:, 0])
     11 frq_low=7.740
   (...)
     15 c.plotall()
     16 '''        

File ~/git/qkit_mod/src/qkit/analysis/resonator.py:232, in Resonator.fit_circle(self, reflection, notch, fit_all, f_min, f_max)
    229 self._prepare_f_range(f_min, f_max)
    231 if self._first_circle:
--> 232     self._prepare_circle()
    233     self._first_circle = False
    235 if self._circle_reflection:

File ~/git/qkit_mod/src/qkit/analysis/resonator.py:345, in Resonator._prepare_circle(self)
    342         self._results[key] = self._hf.add_value_vector('circ_' + key, folder='analysis', x=self._x_co, unit='')
    344 circ_view_amp = self._hf.add_view('circ_amp', x=self._y_co, y=self._ds_amp)
--> 345 circ_view_amp.add(x=self._frequency_co, y=self._circ_amp_gen)
    346 circ_view_pha = self._hf.add_view('circ_pha', x=self._y_co, y=self._ds_pha)
    347 circ_view_pha.add(x=self._frequency_co, y=self._circ_pha_gen)

AttributeError: 'Resonator' object has no attribute '_circ_amp_gen'"

Thank you for any help.
Best regards

@thilokru
Copy link
Collaborator Author

@paoloaq What qkit.cfg['circle_fit_version'] are you using?

@paoloaq
Copy link

paoloaq commented Nov 25, 2024

@thilokru I receive the same exception regardless of the circle_fit_version setting (1 or 2)

@paoloaq
Copy link

paoloaq commented Nov 27, 2024

Hi @thilokru, could you tell me from which commit the issue with the initialization of the Resonator attributes might have been introduced?
I would like to try the most recent version possible that is not affected by the issue.

Thank you so much

@thilokru
Copy link
Collaborator Author

I think it is the one mentioned above, but you could use git bisect to go look for the breaking commit yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants