コード例 #1
0
def _calc_RMSD(x0, y, ppm, spins):

    x0 = np.ndarray.tolist(x0)
    ls = np.zeros_like(ppm)

    for i, s in enumerate(spins):
        s.set_opt_vals(x0)
        if i == 0: ls += Shapes.logistic_basline(ppm, s)
        else: ls += Shapes.Gaussian(ppm, s)
    return np.linalg.norm(y - ls)