L = model.L(Lp)
T = info['temperature (K)']
fit_info = queue.get(block=False)
- mask = numpy.zeros(z_data.shape, dtype=numpy.bool)
- mask[start:stop] = True
- return [FJC_fn(z_data, T=T, L=L, a=a) * mask,
- fit_info]
+ f_data = numpy.ones(z_data.shape, dtype=z_data.dtype) * numpy.nan
+ f_data[start:stop] = FJC_fn(z_data[start:stop], T=T, L=L, a=a)
+ return [f_data, fit_info]
def fit_FJC_PEG_model(self, params, z_data, d_data, start, stop,
outqueue=None):
if True: # TODO: optionally free persistence length
info['Kuhn length (m)'] = (
params['FJC Kuhn length'])
- model = FJC(d_data[start:stop], info=info, rescale=True)
+ model = FJC_PEG(d_data[start:stop], info=info, rescale=True)
queue = Queue()
params = model.fit(outqueue=queue)
if True: # TODO: if Kuhn length fixed
N = model.L(Nr)
T = info['temperature (K)']
fit_info = queue.get(block=False)
- mask = numpy.zeros(z_data.shape, dtype=numpy.bool)
- mask[start:stop] = True
- return [FJC_PEG_fn(z_data, **kwargs) * mask,
- fit_info]
+ f_data = numpy.ones(z_data.shape, dtype=z_data.dtype) * numpy.nan
+ f_data[start:stop] = FJC_PEG_fn(z_data[start:stop], **kwargs)
+ return [f_data, fit_info]
def fit_WLC_model(self, params, z_data, d_data, start, stop,
outqueue=None):
L = model.L(Lp)
T = info['temperature (K)']
fit_info = queue.get(block=False)
- mask = numpy.zeros(z_data.shape, dtype=numpy.bool)
- mask[start:stop] = True
- return [WLC_fn(z_data, T=T, L=L, p=p) * mask,
- fit_info]
-
+ f_data = numpy.ones(z_data.shape, dtype=z_data.dtype) * numpy.nan
+ f_data[start:stop] = WLC_fn(z_data[start:stop], T=T, L=L, p=p)
+ return [f_data, fit_info]
class PolymerFitPeaksCommand (Command):