Commit aded79f1 authored by Yen Wei Ian Yang's avatar Yen Wei Ian Yang
Browse files

Update mfit.py T2 fit function to give option of setting upper bound on f0

parent 7d5abc4a
......@@ -178,14 +178,14 @@ class fit_plugin(object):
self._fit_routine(gmodel, params, plot, print_results, plot_init)
def T2(self, tau0=None, f0=None, phase0=None, amp0=None, vert_offset0=None,
plot=True, print_results=True, plot_init=False):
f_max=None, plot=True, print_results=True, plot_init=False):
"""Fit T2 decay to data
Function used for fitting
math:`amp \cos{2\pi f (x) + \phase} \exp{-(
x)/\tau) + vert_offset`
f_max is upper limit for fitting f0
"""
# Guess values #########################################################
# Vertical offset
......@@ -251,8 +251,10 @@ class fit_plugin(object):
# Set boundaries
params['tau'].min = 0
params['f'].min = 0
if f_max is not None:
params['f'].max = f_max
params['amp'].min = 0
# Fitting ##############################################################
self._fit_routine(gmodel, params, plot, print_results, plot_init)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment