Ejemplo n.º 1
0
 def guess(self, data, x=None, negative=False, **kwargs):
     pars = guess_from_peak(self, data, x, negative, ampscale=0.5, amp_area=False)
     pname = "%s%s" % (self.prefix, 'res')
     pars[pname].value = .1
     pname = "%s%s" % (self.prefix, 'kbT')
     pars[pname].value = .01
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 2
0
def rect_guess(self, data, x=None, **kwargs):
    if x is None:
        return
    ymin, ymax = min(data), max(data)
    xmin, xmax = min(x), max(x)

    ntest = min(2, len(data)/5)
    step_up =  (data[:ntest].mean() > data[-ntest:].mean())


    dydx = savitzky_golay(np.gradient(data)/np.gradient(x), 5, 2)
    cen1 = x[np.where(dydx==dydx.max())][0]
    cen2 = x[np.where(dydx==dydx.min())][0]
    if step_up:
        center1 = cen1 # + (xmax+xmin)/4.0)/2.
        center2 = cen2 # + 3*(xmax+xmin)/4.0)/2.
    else:
        center1 = cen2 # + (xmax+xmin)/4.0)/2.0
        center2 = cen1 # + 3*(xmax+xmin)/4.0)/2.0

    pars = self.make_params(amplitude=(ymax-ymin),
                            center1=center1, center2=center2)

    pars['%ssigma1' % self.prefix].set(value=(xmax-xmin)/5.0, min=0.0)
    pars['%ssigma2' % self.prefix].set(value=(xmax-xmin)/5.0, min=0.0)
    return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 3
0
    def guess(self, data, x=None, **kwargs):
        data = data.flatten()
        offset = np.mean(data)

        pars = self.make_params(offset_re=float(np.real(offset)),
                                offset_im=float(np.imag(offset)))
        return update_param_vals(pars, self.prefix, **kwargs)[0]
Ejemplo n.º 4
0
def rect_guess(self, data, x=None, **kwargs):
    if x is None:
        return
    ymin, ymax = min(data), max(data)
    xmin, xmax = min(x), max(x)

    ntest = min(2, len(data) / 5)
    step_up = (data[:ntest].mean() > data[-ntest:].mean())

    dydx = savitzky_golay(np.gradient(data) / np.gradient(x), 5, 2)
    cen1 = x[np.where(dydx == dydx.max())][0]
    cen2 = x[np.where(dydx == dydx.min())][0]
    if step_up:
        center1 = cen1  # + (xmax+xmin)/4.0)/2.
        center2 = cen2  # + 3*(xmax+xmin)/4.0)/2.
    else:
        center1 = cen2  # + (xmax+xmin)/4.0)/2.0
        center2 = cen1  # + 3*(xmax+xmin)/4.0)/2.0

    pars = self.make_params(amplitude=(ymax - ymin),
                            center1=center1,
                            center2=center2)

    pars['%ssigma1' % self.prefix].set(value=(xmax - xmin) / 5.0, min=0.0)
    pars['%ssigma2' % self.prefix].set(value=(xmax - xmin) / 5.0, min=0.0)
    return update_param_vals(pars, self.prefix, **kwargs)
    def guess(self, data, **kwargs):
        """Guess parameters as gamma=2, H_k=0, M_s~(pi.f)^2/(mu_0^2.H)-H"""

        x = kwargs.get("x", np.linspace(1, len(data), len(data) + 1))

        v_offset_guess = np.mean(data)
        v = np.abs(data - v_offset_guess)
        x = np.abs(x)

        v_low = np.max(v) * 0.05
        v_high = np.max(v) * 0.90

        ic_index = v < v_low
        rn_index = v > v_high
        ic_guess = np.max(
            x[ic_index])  # Guess Ic from a 2% of max V threhsold creiteria

        rn_guess = np.mean(v[rn_index] / x[rn_index])

        pars = self.make_params(Ic_p=ic_guess,
                                Ic_n=-ic_guess,
                                Rn=rn_guess,
                                V_offset=v_offset_guess)
        pars["Ic_p"].min = 0
        pars["Ic_n"].max = 0
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 6
0
    def guess(self, data, x, **kwargs):

        """Guess starting values for the parameters of a model.

          Parameters
          ----------
          data: :class:`~numpy:numpy.ndarray`
                data to be fitted

          x: :class:`~numpy:numpy.ndarray`
                energy domain where the interpolation required

          kwargs : dict
                additional optional arguments, passed to model function.

          Returns
          -------
          :class:`~lmfit.parameter.Parameters`
                parameters with guessed values

        """
        params = self.make_params()

        def pset(param, value):
            params["%s%s" % (self.prefix, param)].set(value=value)

        x_at_max = x[models.index_of(data, max(data))]
        ysim = self.eval(x=x_at_max, amplitude=1, center=x_at_max)
        amplitude = max(data) / ysim
        pset("amplitude", amplitude)
        pset("center",  x_at_max)
        return models.update_param_vals(params, self.prefix, **kwargs)
Ejemplo n.º 7
0
 def guess(self, data, x=None, negative=False, **kwargs):
     pars = self.make_params()
     pars['%samplitude' % self.prefix].set(value=data.max() - data.min())
     try:
         pars['%scenter' % self.prefix].set(value=(x.min() + x.max() )/2)
     except AttributeError:
         pass
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 8
0
 def guess(self, data, x=None, **kwargs):
     sxval, syval, oval = 0., 0., 0.
     if x is not None:
         not_nan_inds = ~np.isnan(data)
         sxval, oval = np.polyfit(x[0][not_nan_inds], data[not_nan_inds], 1)
         syval, oval = np.polyfit(x[1][not_nan_inds], data[not_nan_inds], 1)
     pars = self.make_params(intercept=oval, slope_x=sxval, slope_y=syval)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 9
0
 def guess(self, data, x=None, negative=False, **kwargs):
     pars = guess_from_peak_2D(self,
                               data,
                               x,
                               negative,
                               ampscale=1.,
                               amp_area=False)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 10
0
 def guess(self, data, x=None, **kwargs):
     sxval, syval, oval = 0., 0., 0.
     if x is not None:
         not_nan_inds = ~np.isnan(data)
         sxval, oval = np.polyfit(x[0][not_nan_inds], data[not_nan_inds], 1)
         syval, oval = np.polyfit(x[1][not_nan_inds], data[not_nan_inds], 1)
     pars = self.make_params(intercept=oval, slope_x=sxval, slope_y=syval)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 11
0
    def guess(self, data, x=None, **kwargs):
        _kb=consts.physical_constants['Boltzmann constant'][0]/consts.physical_constants['elementary charge'][0]

        d1,d2 = 1.,0.0
        if x is not None:
            d1,d2=_np_.polyfit(-1.0/x,_np_.log(data),1)
        pars = self.make_params(A=_np_.exp(d2), dE=_kb*d1,n=1.0)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 12
0
    def guess(self, data, x=None, **kwargs):
        _kb = consts.physical_constants['Boltzmann constant'][
            0] / consts.physical_constants['elementary charge'][0]

        d1, d2 = 1., 0.0
        if x is not None:
            d1, d2 = _np_.polyfit(-1.0 / x, _np_.log(data), 1)
        pars = self.make_params(A=_np_.exp(d2), dE=_kb * d1, n=1.0)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 13
0
 def guess(self, data, B=None, **kwargs):
     s0, DS, B1, B2 = 1.0, 1.0, 1.0, 1.0
     if B is not None:
         zpos = _np_.argmin(_np_.abs(B))
         s0 = data[zpos]
         B1 = _np_.max(B) / 2.0
         B2 = B1
         DS = 1.0
     pars = self.make_params(s0=s0, DS=DS, B1=B1, B2=B2)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 14
0
    def guess(self, data, x=None, **kwargs):
        data = data.flatten()
        slope = (data[-1]-data[0])/(x[-1] - x[0])
        intercept = data[0] - slope*x[0]

        pars = self.make_params(intercept_re=float(np.real(intercept)),
                                intercept_im=float(np.imag(intercept)),
                                slope_re=float(np.real(slope)),
                                slope_im=float(np.imag(slope))),
        return update_param_vals(pars, self.prefix, **kwargs)[0]
Ejemplo n.º 15
0
    def guess(self, data, x=None, **kwargs):
        """Guess paramneters from a set of data."""
        _kb = consts.physical_constants["Boltzmann constant"][
            0] / consts.physical_constants["elementary charge"][0]

        d1, d2 = 1.0, 0.0
        if x is not None:
            d1, d2 = np.polyfit(-1.0 / x, np.log(data / x), 1)
        pars = self.make_params(A=np.exp(d2), DE=_kb * d1, n=1.0)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 16
0
 def guess(self, data, B=None, **kwargs):
     s0,DS,B1,B2=1.0,1.0,1.0,1.0
     if B is not None:
         zpos=_np_.argmin(_np_.abs(B))
         s0=data[zpos]
         B1=_np_.max(B)/2.0
         B2=B1
         DS=1.0
     pars = self.make_params(s0=s0,DS=DS,B1=B1,B2=B2)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 17
0
 def guess(self, data, B=None, **kwargs):
     """Guess parameters for weak localisation fit."""
     s0, DS, B1, B2 = 1.0, 1.0, 1.0, 1.0
     if B is not None:
         zpos = np.argmin(np.abs(B))
         s0 = data[zpos]
         B1 = np.max(B) / 2.0
         B2 = B1
         DS = 1.0
     pars = self.make_params(s0=s0, DS=DS, B1=B1, B2=B2)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 18
0
    def guess(self, data, x=None, **kwargs):
        """Guess paramneters from a set of data."""
        _kb = consts.physical_constants["Boltzmann constant"][
            0] / consts.physical_constants["elementary charge"][0]

        d1, d2, x0 = 1.0, 0.0, 1.0
        if x is not None:
            x0 = x[np.argmin(np.abs(data))]
            d1, d2 = np.polyfit(-1.0 / (x - x0), np.log(data), 1)
        pars = self.make_params(A=np.exp(d2), dE=_kb * d1, x_0=x0)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 19
0
 def guess(self, data, x=None, **kwargs):
     """Guess some starting values."""
     Ms = data.max() * 1.001
     if x is not None:
         y = np.log(1 - data / Ms)
         X = np.log(x)
         d2 = np.polyfit(X, y, 1)[1]
         x0 = np.exp(d2 * 2 / 3)
     else:
         x0 = len(data)
     pars = self.make_params(Ms=Ms, Tc=x0)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 20
0
 def guess(self, data, x=None, **kwargs):
     """Guess parameters for weak localisation fit."""
     s0, DS, B1, B2 = 1.0, 1.0, 1.0, 1.0
     if x is not None:
         zpos = np.argmin(np.abs(x))
         s0 = data[zpos]
         B1 = np.max(x) / 20.0
         B2 = B1 * 10
         DS = 1.0
     pars = self.make_params(s0=s0, DS=DS, B1=B1, B2=B2)
     for p in pars:
         pars[p].min = 0.0
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 21
0
    def guess(self, data, x=None, **kwargs):
        """Guess parameters as gamma=2, H_k=0, M_s~(pi.f)^2/(mu_0^2.H)-H"""

        M_s = (_np_.pi * data / consts.mu0) / x - x
        M_s = _np_.mean(M_s[1:])
        g = 2

        pars = self.make_params(g=g, M_s=M_s, H_k=100.0)
        pars["M_s"].min = 0
        pars["g"].min = g / 100
        pars["H_k"].min = 0
        pars["H_k"].max = M_s.max()
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 22
0
    def guess(self, data, x=None, **kwargs):
        """Estimate initial model parameter values from data.

        Args:
            data (array_like): y data points
            x (array_like): x data points

        Returns:
            lmfit.parameter.Parameters: Guessed parameters

        """
        pars = guess_voigt(self, data, x)

        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 23
0
 def guess(self, data, x=None, **kwargs):
     """Guess parameters for the stretched exponential from data."""
     A, beta, x0 = 1.0, 1.0, 1.0
     if x is not None:
         A = data[np.argmin(np.abs(x))]
         x = np.log(x)
         y = np.log(-np.log(data / A))
         d = np.column_stack((x, y))
         d = d[~np.isnan(d).any(axis=1)]
         d = d[~np.isinf(d).any(axis=1)]
         d1, d2 = np.polyfit(d[:, 0], d[:, 1], 1)
         beta = d1
         x0 = np.exp(d2 / beta)
     pars = self.make_params(A=A, beta=beta, x_0=x0)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 24
0
    def guess(self, data, x=None, **kwargs):
        """Guess parameters as gamma=2, H_k=0, M_s~(pi.f)^2/(mu_0^2.H)-H"""
        g = 2
        H_k = 100
        gamma = g * cnst.e / (2 * cnst.m_e)
        M_s = (4 * np.pi**2 * data**2 - gamma**2 * cnst.mu_0**2 *
               (x**2 + 2 * x * H_k + H_k**2)) / (gamma**2 * cnst.mu_0**2 *
                                                 (x + H_k))
        M_s = np.mean(M_s)

        pars = self.make_params(g=g, M_s=M_s, H_k=H_k)
        pars["M_s"].min = 0
        pars["g"].min = g / 100
        pars["H_k"].min = 0
        pars["H_k"].max = M_s.max()
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 25
0
    def guess(self, data, x=None, **kwargs):  # pylint: disable=unused-argument
        """Guess some starting values - not very clever"""
        rho0 = data.min()

        if x is None:
            t = np.linspace(0, 1, len(data))
        else:
            t = x / x.max()
        y = data - data.min()
        t = t[y > 0.05 * y.max()]
        y = y[y > 0.05 * y.max()]
        A = np.polyfit(t, y, 1)[0]

        pars = self.make_params(thetaD=500, rho0=rho0, A=A, n=5.0)
        pars["A"].min = 0
        pars["n"].vary = False
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 26
0
def step_guess(self, data, x=None, **kwargs):
    if x is None:
        return
    ymin, ymax = min(data), max(data)
    xmin, xmax = min(x), max(x)
    ntest = min(2, len(data)/5)
    step_up =  (data[:ntest].mean() > data[-ntest:].mean())

    dydx = savitzky_golay(np.gradient(data)/np.gradient(x), 5, 2)
    if step_up:
        cen = x[np.where(dydx==dydx.max())][0]
    else:
        cen = x[np.where(dydx==dydx.min())][0]

    pars = self.make_params(amplitude=(ymax-ymin), center=cen)
    pars['%ssigma' % self.prefix].set(value=(xmax-xmin)/5.0, min=0.0)
    return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 27
0
def step_guess(self, data, x=None, **kwargs):
    if x is None:
        return
    ymin, ymax = min(data), max(data)
    xmin, xmax = min(x), max(x)
    ntest = min(2, len(data) / 5)
    step_up = (data[:ntest].mean() > data[-ntest:].mean())

    dydx = savitzky_golay(np.gradient(data) / np.gradient(x), 5, 2)
    if step_up:
        cen = x[np.where(dydx == dydx.max())][0]
    else:
        cen = x[np.where(dydx == dydx.min())][0]

    pars = self.make_params(amplitude=(ymax - ymin), center=cen)
    pars['%ssigma' % self.prefix].set(value=(xmax - xmin) / 5.0, min=0.0)
    return update_param_vals(pars, self.prefix, **kwargs)
    def guess(self, data, **kwargs):
        """Guess parameters as max(data), x[argmax(data)] and from FWHM of peak"""

        x = kwargs.get("x",
                       np.linspace(-len(data) / 2,
                                   len(data) / 2, len(data)))

        Ic0_guess = data.max()
        B_offset_guess = x[data.argmax()]
        tmp = np.abs(data - (data.max() / 2))
        x0 = np.abs(x[tmp.argmin()] - B_offset_guess)
        A_guess = 2.2 * Phi_0 / (np.pi * x0)

        pars = self.make_params(Ic0=Ic0_guess,
                                B_offset=B_offset_guess,
                                A=A_guess)
        pars["Ic0"].min = 0
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 29
0
    def guess(self, data, x=None, **kwargs):
        """
        Estimate initial anchor points through a dataset for the fitting of a cubic spline.

        Args:
            data (array_like): y data points
            x (array_like): x data points

        Returns:
            lmfit.parameter.Parameters: Guessed parameters
        """

        pars = self.make_params()

        spacing = np.linspace(np.min(x), np.max(x), self.n_anchors)
        spacing_idx = [(np.abs(x - space)).argmin() for space in spacing]

        data = np.asarray(data)

        x_anchors = [x[i] for i in spacing_idx]
        for i, coef in enumerate(x_anchors[::1]):
            pars['%sx_%i' % (self.prefix, i)].set(value=coef, vary=False)

        y_anchors = []
        for i in spacing_idx:
            if i == 0:
                ymin = i
                ymax = i + int(len(x) / self.n_anchors)
                y_anchors.append(np.median(data[ymin:ymax]))
            elif i == len(x) - 1:
                ymin = i - int(len(x) / self.n_anchors)
                ymax = i
                y_anchors.append(np.median(data[ymin:ymax]))
            else:
                ymin = i - int(len(x) / self.n_anchors)
                ymax = i + int(len(x) / self.n_anchors)
                y_anchors.append(np.median(data[ymin:ymax]))

        for i, coef in enumerate(y_anchors[::1]):
            pars['%sy_%i' % (self.prefix, i)].set(value=coef,
                                                  min=0,
                                                  max=2 * np.max(data))

        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 30
0
    def guess(self, data, x=None, **kwargs):
        """Guess paramneters from a set of data."""
        _kb = consts.physical_constants["Boltzmann constant"][
            0] / consts.physical_constants["elementary charge"][0]
        d1, d2, x0 = 1.0, 0.0, 1.0
        yy = np.log(data)
        if x is not None:
            # Getting a good x_0 is critical, so we first of all use poly fit to look
            x0 = x[np.argmin(np.abs(data))] * 0.95

            def _find_x0(x, d1, d2, x0):
                X = np.where(np.isclose(x, x0), 1e-8, x - x0)
                y = d2 - (d1 / X)
                return y

            popt = curve_fit(_find_x0, x, yy, p0=[1.0 / _kb, 25, x0])[0]
            d1, d2, x0 = popt
        pars = self.make_params(A=np.exp(d2), DE=_kb * d1, x_0=x0)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 31
0
    def guess(self, data, x=None, **kwargs):
        r"""Guess some starting values.

        M_s is taken as half the difference of the range of thew M data,
        we can find m/T from the susceptibility :math:`chi= M_s \mu_o m / kT`,"""
        M_s = (np.max(data) - np.min(data)) / 2.0
        if x is not None:
            d = np.sort(np.row_stack((x, data)))
            dd = savgol_filter(d, 7, 1)
            yd = dd[1] / dd[0]
            chi = np.interp(np.array([0]), d[0], yd)[0]
            mT = chi / M_s * (k / mu_0)
            # Assume T=150K for no good reason
            m = mT * 150
        else:
            m = 1e6 * (e * hbar) / (2 * electron_mass
                                    )  # guess 1 million Bohr Magnetrons
        T = 150
        pars = self.make_params(M_s=M_s, m=m, T=T)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 32
0
    def guess(self, x, y, **kwargs):
        """Takes x and y data and generates initial guesses for
        fit parameters.
        """
        ym = y.min()
        yM = y.max()
        a_guess = 0.5 * (yM - ym) * 1.2
        b_guess = 0.5 * (yM + ym)
        t_guess = 0.25 * x[-1]
        d_guess = get_freq_from_fft(x, y, b_guess)
        x_guess = 0.0

        pars = self.make_params(baseline=b_guess, amplitude=a_guess,
                                T2=t_guess, detuning=d_guess, x0=x_guess)
        pars['amplitude'].value = kwargs.pop('amplitude_guess', a_guess)
        pars['baseline'].value = kwargs.pop('baseline_guess', b_guess)
        pars['T2'].value = kwargs.pop('T2_guess', t_guess)
        pars['detuning'].value = kwargs.pop('detuning_guess', d_guess)
        pars['x0'].value = kwargs.pop('x0_guess', x_guess)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 33
0
    def guess(self, data, x=None, **kwargs):
        """Guess parameters as gamma=2, H_k=0, M_s~(pi.f)^2/(mu_0^2.H)-H"""

        if x is None:
            x = np.linspace(1, len(data), len(data) + 1)

        x1 = x[np.argmax(data)]
        x2 = x[np.argmin(data)]
        sigma = abs(x1 - x2)
        mu = (x1 + x2) / 2.0
        y1 = np.max(data)
        y2 = np.min(data)
        dy = y1 - y2
        A = dy * (4 * np.pi * sigma**2) / (3 * np.sqrt(3))

        pars = self.make_params(A=A, sigma=sigma, mu=mu)
        pars["A"].min = 0
        pars["sigma"].min = 0
        pars["mu"].min = np.min(x)
        pars["mu"].max = np.max(x)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 34
0
    def guess(self, data, h=None, **kwargs):
        """Guess some starting values.

        M_s is taken as half the difference of the range of thew M data,
        we can find m/T from the susceptibility chi= M_s \mu_o m / kT,"""
        from scipy.signal import savgol_filter
        from scipy.constants import k, mu_0, e, electron_mass, hbar

        M_s = (_np_.max(data) - _np_.min(data)) / 2.0
        if h is not None:
            d = _np_.sort(_np_.row_stack((h, data)))
            dd = savgol_filter(d, 7, 1)
            yd = dd[1] / dd[0]
            chi = _np_.interp(_np_.array([0]), d[0], yd)[0]
            mT = chi / M_s * (k / mu_0)
            #Assume T=150K for no good reason
            m = mT * 150
        else:
            m = 1E6 * (e * hbar) / (2 * electron_mass
                                    )  # guess 1 million Bohr Magnetrons
        T = 150
        pars = self.make_params(M_s=M_s, m=m, T=T)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 35
0
    def guess(self, data, x=None, **kwargs):
        r"""Guess parameters as :math:`\gamma=2, H_k=0, M_s~(\pi f)^2/\mu_0^2.H)-H`."""
        if x is None:
            x = np.linspace(1, len(data), len(data) + 1)

        x1 = x[np.argmax(data)]
        x2 = x[np.argmin(data)]
        Delta_H = abs(x1 - x2)
        H_res = (x1 + x2) / 2.0
        y1 = np.max(data)
        y2 = np.min(data)
        dy = y1 - y2
        K_2 = dy * (4 * np.pi * Delta_H**2) / (3 * np.sqrt(3))
        ay = (y1 + y2) / 2
        K_1 = ay * np.pi / Delta_H

        pars = self.make_params(Delta_H=Delta_H, H_res=H_res, K_1=K_1, K_2=K_2)
        pars["K_1"].min = 0
        pars["K_2"].min = 0
        pars["Delta_H"].min = 0
        pars["H_res"].min = np.min(x)
        pars["H_res"].max = np.max(x)
        return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 36
0
 def guess(self, data, V=None, **kwargs):
     """Just set the A, phi,dphi,d and mass values to typical answers for a small tunnel junction"""
     pars = self.make_params(A=1E-12,phi=3.0,d=10.0,dphi=1.0,mass=1.0)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 37
0
 def guess(self, data, V=None, **kwargs):
     """Just set the A, phi and d values to typical answers for a small tunnel junction"""
     pars = self.make_params(A=_np_.mean(data/V))
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 38
0
 def guess(self, data, V=None, **kwargs):
     """Guess starting values for a good Nb contact to a ferromagnet at 4.2K"""
     pars = self.make_params(omega=0.36,delta=1.50,P=0.42,Z=0.15)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 39
0
 def guess(self, data, t=None, **kwargs):
     """Guess some starting values - not very clever"""
     pars = self.make_params(l=10.0,p=0.5,sigma_0=10.0)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 40
0
 def guess(self, data, t=None, **kwargs):
     """Guess some starting values - not very clever"""
     pars = self.make_params(thetaD=900,rho0=0.01,A=0.2,n=5.0)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 41
0
 def guess(self, data, x=None, negative=False, **kwargs):
     pars = guess_from_peak_2D(self, data, x, negative, ampscale=1., amp_area=False)
     return update_param_vals(pars, self.prefix, **kwargs)
Ejemplo n.º 42
0
    def guess(self, data, **kwargs):
        pars = self.make_params()

        pars['%sc' % self.prefix].set(value=data.mean())
        return update_param_vals(pars, self.prefix, **kwargs)