pyepr.ResonatorProfileAnalysis¶
- class pyepr.ResonatorProfileAnalysis(dataset, f_lims=(32, 36), attentuator=0, R_limit=0.2, bounds=None, p0=None, **kwargs)[source]¶
Analysis and calculation of resonator profiles.
Fitting fuction:
\nu(t) = a \cos(2\pi f (t - x_0)) e^{-(t - x_0)/\tau} + k
where a is the amplitude, f is the nutation frequency, \tau is the decay time, x_0 is the offset and k is a constant offset. The fit is performed for each frequency in the dataset. The fit is performed using the curve_fit function from scipy.optimize.
- Parameters:
- datasetxr.xarray
The dataset containing the nutations. It must have both a ‘LO’ axis and a ‘pulse0_tp’ axis.
- f_limstuple, optional
The frequency limits of the resonator profile, by default (33,35)
- attenuator: int
The value of the main attentuator in dB, by default 0
- R_limit: float, optional
The R^2 limit for extracting fits, by default 0.2
- boundstuple, optional
The bounds for the fit in the form ([lower bounds],[upper bounds]), by default None. If not given the bounds are set to ([5e-3,10,0,-1,-5],[0.3,2000,2,1,5])
- p0list, optional
The initial guess for the fit, by default None. If not given the guess is set to [50e-3,150,1,0]
Attributes
- n_files¶
- t¶
- f_lims = (32, 36)¶
- attenuator = 0¶
Methods
- process_nutations(noisedensity=None, threshold=2, nfft=1000, **kwargs)[source]¶
Uses a power series to extract the resonator profile.
- Parameters:
- noisedensitytuple, optional
If not given the first trace is assumed to be so far off resonance that it is just noise.
- nfft: int, optional
The length of the fft to be used, zero padded if requred, default is 1000.
- threshold: int, optional
The multiples above the noise a single must be to not be excluded, default is 2.
- Returns:
- prof_data: np.ndarray
The resonator profile, give in nutation frequency (GHz)
- prof_frqs: np.ndarray
The frequency axis in GHz
- Parameters:
noisedensity (float)
threshold (int)
nfft (int)