Skip to content
Snippets Groups Projects

Cnms dev

Merged Vasudevan, Rama K. requested to merge cnms_dev into master
4 files
+ 352
96
Compare changes
  • Side-by-side
  • Inline
Files
4
  • 85d93001
    Fitting update · 85d93001
    Chris Smith authored
    SHO Guess in serial and parallel modes
    SHO FIt works in serial, but there are still problems with the parallel implementation.
@@ -23,7 +23,7 @@ def SHOfunc(parms, w_vec):
return parms[0] * exp(1j * parms[3]) * parms[1] ** 2 / (w_vec ** 2 - 1j * w_vec * parms[1] / parms[2] - parms[1] ** 2)
def SHOestimateFit(w_vec, resp_vec, num_points=5):
def SHOestimateGuess(w_vec, resp_vec, num_points=5):
"""
Generates good initial guesses for fitting
@@ -42,8 +42,7 @@ def SHOestimateFit(w_vec, resp_vec, num_points=5):
SHO fit parameters arranged as amplitude, frequency, quality factor, phase
"""
# num_points=5
ii= np.argsort(abs(resp_vec))[::-1]
ii = np.argsort(abs(resp_vec))[::-1]
a_mat=np.array([])
e_vec=np.array([])
@@ -125,7 +124,6 @@ def SHOfastGuess(w_vec, resp_vec, qual_factor=10):
i_max = np.argmax(amp_vec)
return np.array([np.max(amp_vec) / qual_factor, w_vec[i_max], qual_factor, np.angle(resp_vec[i_max])])
def SHOlowerBound(w_vec):
"""
Provides the lower bound for the SHO fitting function
Loading