:mod:`hooke.curve` classes.
"""
+import numpy
+
from ..command import Command, Argument, Failure
from ..curve import Data
from ..plugin import Builtin
help=self.__doc__, plugin=plugin)
def _run(self, hooke, inqueue, outqueue, params):
- data = params['curve'].data[params['block']]
- f = open(params['output'], 'w')
- data.tofile(f, sep='\t')
- f.close()
+ data = params['curve'].data[int(params['block'])] # HACK, int() should be handled by ui
+ numpy.savetxt(params['output'], data, delimiter='\t')
class DifferenceCommand (Command):
"""Calculate the derivative (actually, the discrete differentiation)
:class:`CutCommand`.
"""
+import numpy
+
from ..command import Command, Argument, Failure
from ..plugin import Plugin
cut_data = data[i_min:i_max+1,:] # slice rows from row-major data
# +1 to include data[i_max] row
- f = open(params['output'], 'w')
- cut_data.tofile(f, sep='\t')
- f.close()
+ numpy.savetxt(params['output'], cut_data, delimiter='\t')