import numpy
from scipy.optimize import newton
-from ..command import Command, Argument, Failure
+from ..command import Command, Argument, Success, Failure
from ..config import Setting
from ..curve import Data
from ..plugin import Plugin, argument_to_setting
help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
- print params['curve'], id(params['curve']), 'PFC'
for key,value in params.items():
if value == None: # Use configured default value.
params[key] = self.plugin.config[key]
new[:,:-1] = data
new.info['columns'].append(
join_data_label(params['output tension column'], 'N'))
- print 'add column', id(params['curve']), new.info['columns'][-1], 'to', new.info['columns'][:-1]
z_data = data[:,data.info['columns'].index(
params['input distance column'])]
d_data = data[:,data.info['columns'].index(
params, z_data, d_data, start, stop, outqueue)
new.info[params['fit parameters info name']] = ps
new.info[params['fit parameters info name']]['model'] = model
- print 'add info', params['fit parameters info name']
new[:,-1] = tension_data
params['curve'].data[params['block']] = new
help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
- print params['curve'], id(params['curve']), 'PFPC'
data = params['curve'].data[params['block']]
fit_command = [c for c in hooke.commands
if c.name=='polymer fit'][0]
p['output tension column'] = peak.name
p['fit parameters info name'] = peak.name
fit_command.run(hooke, inq, outq, **p)
+ ret = outq.get()
+ if not isinstance(ret, Success):
+ raise ret
# TODO:
# def dist2fit(self):