-# Copyright
+# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+#
+# This file is part of Hooke.
+#
+# Hooke is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation, either
+# version 3 of the License, or (at your option) any later version.
+#
+# Hooke is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Hooke. If not, see
+# <http://www.gnu.org/licenses/>.
"""The `calculus` module provides functions for calculating
derivatives and integrals of discrete data.
Notes
-----
- Weights
- ~~~~~~~
+ *Weights*
The returned :class:`Data` block shares its x vector with the
input data. The ith df/dx value in the returned data is
The default scheme is central differencing.
- Boundary conditions
- ~~~~~~~~~~~~~~~~~~~
+ *Boundary conditions*
- These could be configurable in principle. The current scheme just
- extrapolates virtual points out to negative `i` following::
+ The boundary conditions could be configurable in principle. The
+ current scheme just extrapolates virtual points out to negative
+ `i` following::
f[i<0] = 2*f[0] - f[-i]
for j in range(1,zero+1):
chunk[zero-j] = 2*chunk[zero] - chunk[zero+j]
chunks.append(chunk)
- print chunks
output[:,0] = data[:,x_col]
output[:,1] = sum(chunks)
return output