spline
index
/usr/local/python/epics/spline.py

Cubic spline approximation class.
 
Last Modified 9/9/97 by Johann Hibschman <johann@physics.berkeley.edu>
 
To create a default ("natural") spline, simply use sp = Spline(x,y).
To specify the slope of the function at either of the endpoints,
use the "low_slope" and "high_slope" keywords.
 
Example usage:
>>> x = arange(10, typecode=Float) * 0.3
>>> y = cos(x)
>>> sp = Spline(x, y)
>>> print sp(0.5), cos(0.5)
0.878364380585 0.87758256189
 
Uses "searchsorted" from the Numeric module, aka "binarysearch" in older
versions.

 
Modules
            
copy
copy_reg
func
math
multiarray
pickle
string
types
 
Classes
            
func.FuncOps
LinInt
Spline
 
class LinInt(func.FuncOps)
       
   Methods defined here:
__call__(self, arg)
Simulate a ufunc; handle being called on an array.
__init__(self, x_array, y_array)
call(self, x)
Evaluate the interpolant, assuming x is a scalar.

Data and non-method functions defined here:
__doc__ = None
__module__ = 'spline'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from func.FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
class Spline(func.FuncOps)
       
   Methods defined here:
__call__(self, arg)
Simulate a ufunc; handle being called on an array.
__init__(self, x_array, y_array, low_slope=None, high_slope=None)
calc_ypp(self)
call(self, x)
Evaluate the spline, assuming x is a scalar.

Data and non-method functions defined here:
__doc__ = None
__module__ = 'spline'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

Methods inherited from func.FuncOps:
__add__(self, f)
__coerce__(self, x)
__div__(self, f)
__mul__(self, f)
__neg__(self)
__pow__(self, f)
__sub__(self, f)
compose(self, f)
exp(self)
log(self)
 
Functions
            
arange(...)
arange(start, stop=None, step=1, typecode=None)
 
 Just like range() except it returns an array whose type can be
specified by the keyword argument typecode.
array(...)
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode.  If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence.  If copy is zero and sequence is already an array, a reference will be returned.  If savespace is nonzero, the new array will maintain its precision in operations.
arrayrange = arange(...)
arange(start, stop=None, step=1, typecode=None)
 
 Just like range() except it returns an array whose type can be
specified by the keyword argument typecode.
choose(...)
choose(a, (b1,b2,...))
cross_correlate(...)
cross_correlate(a,v, mode=0)
fromstring(...)
fromstring(string, typecode='l', count=-1) returns a new 1d array initialized from the raw binary data in string.  If count is positive, the new array will have count elements, otherwise it's size is determined by the size of string.
linear_interpolate(x1, y1, x2)
Given a function at a set of points (x1, y1), interpolate to
evaluate it at points x2.
logspline_interpolate(x1, y1, x2)
Given a function at a set of points (x1, y1), interpolate to
evaluate it at points x2.
reshape(...)
reshape(a, (d1, d2, ..., dn)).  Change the shape of a to be an n-dimensional array with dimensions given by d1...dn.  Note: the size specified for the new array must be exactly equal to the size of the  old one or an error will occur.
searchsorted = binarysearch(...)
binarysearch(a,v)
spline_interpolate(x1, y1, x2)
Given a function at a set of points (x1, y1), interpolate to
evaluate it at points x2.
take(...)
take(a, indices, axis=0).  Selects the elements in indices from array a along the given axis.
zeros(...)
zeros((d1,...,dn),typecode='l',savespace=0) will return a new array of shape (d1,...,dn) and type typecode with all it's entries initialized to zero.  If savespace is nonzero the array will be a spacesaver array.
 
Data
             BadInput = 'Bad xa input to routine splint.'
Character = 'c'
Complex = 'D'
Complex0 = 'F'
Complex16 = 'F'
Complex32 = 'F'
Complex64 = 'D'
Complex8 = 'F'
Float = 'd'
Float0 = 'f'
Float16 = 'f'
Float32 = 'f'
Float64 = 'd'
Float8 = 'f'
Int = 'l'
Int0 = '1'
Int16 = 's'
Int32 = 'i'
Int8 = '1'
LittleEndian = 1
NewAxis = None
PrecisionError = 'PrecisionError'
PyObject = 'O'
UInt = 'u'
UInt16 = 'w'
UInt32 = 'u'
UInt8 = 'b'
UnsignedInt16 = 'w'
UnsignedInt32 = 'u'
UnsignedInt8 = 'b'
UnsignedInteger = 'u'
__file__ = './spline.pyc'
__name__ = 'spline'
absolute = <ufunc 'absolute'>
add = <ufunc 'add'>
arccos = <ufunc 'arccos'>
arccosh = <ufunc 'arccosh'>
arcsin = <ufunc 'arcsin'>
arcsinh = <ufunc 'arcsinh'>
arctan = <ufunc 'arctan'>
arctan2 = <ufunc 'arctan2'>
arctanh = <ufunc 'arctanh'>
bitwise_and = <ufunc 'bitwise_and'>
bitwise_or = <ufunc 'bitwise_or'>
bitwise_xor = <ufunc 'bitwise_xor'>
ceil = <ufunc 'ceil'>
conjugate = <ufunc 'conjugate'>
cos = <ufunc 'cos'>
cosh = <ufunc 'cosh'>
divide = <ufunc 'divide'>
divide_safe = <ufunc 'divide_safe'>
e = 2.7182818284590451
equal = <ufunc 'equal'>
exp = <ufunc 'exp'>
fabs = <ufunc 'fabs'>
floor = <ufunc 'floor'>
floor_divide = <ufunc 'floor_divide'>
fmod = <ufunc 'fmod'>
greater = <ufunc 'greater'>
greater_equal = <ufunc 'greater_equal'>
hypot = <ufunc 'hypot'>
invert = <ufunc 'invert'>
left_shift = <ufunc 'left_shift'>
less = <ufunc 'less'>
less_equal = <ufunc 'less_equal'>
log = <ufunc 'log'>
log10 = <ufunc 'log10'>
logical_and = <ufunc 'logical_and'>
logical_not = <ufunc 'logical_not'>
logical_or = <ufunc 'logical_or'>
logical_xor = <ufunc 'logical_xor'>
maximum = <ufunc 'maximum'>
minimum = <ufunc 'minimum'>
multiply = <ufunc 'multiply'>
negative = <ufunc 'negative'>
not_equal = <ufunc 'not_equal'>
pi = 3.1415926535897931
power = <ufunc 'power'>
remainder = <ufunc 'remainder'>
right_shift = <ufunc 'right_shift'>
sin = <ufunc 'sin'>
sinh = <ufunc 'sinh'>
sqrt = <ufunc 'sqrt'>
subtract = <ufunc 'subtract'>
tan = <ufunc 'tan'>
tanh = <ufunc 'tanh'>
true_divide = <ufunc 'true_divide'>
typecodes = {'Character': 'c', 'Complex': 'FD', 'Float': 'fd', 'Integer': '1sil', 'UnsignedInteger': 'bwu'}