__init__(self,
x,
func=<function interp_file at 0x10b959d70>,
dfunc=None,
order=3,
*args,
**kwargs)
(Constructor)
| source code
|
Create an instance of the Profiler() class. Requires a coordinate grid
and a function object for the profile. A function for the derivative is
optional. The functions can also be given as an interpolation object.
The optional args and kwargs give the additional arguments for the two
function, which are ignored in case func is an interpolation object.
The default coordinate grid is evaluated for both the function and the
derivative. They are saved in self.y and self.dydx. Alternatively, new
evaluations can be attained through eval and diff.
Note that if func is an interpolator object, the original input x and
y grids can be passed as additional keywords xin and yin, which would
then be arrays. Otherwise, the x and the interpolator(x) are set as xin
and yin. xin and yin are ignored if func is a function, even if it
returns an interpolator (in which case the original grids are known)
- Parameters:
x (array) - The default coordinate points, minimum three points. In the case
of an interpolation function, this is the default grid returned
by the instance. The original x/y of the interpolated profile are
saved as xori/yori in the object.
func (function/interp1d object) - The function that describes the profile with respect to x. Can be
given as an interp1d object. Default is a read function that
interpolates data and returns the interpolator object. If
interpolation object, x and eval(x) are assumed to be the
original grids, unless xin and yin are given as keywords with
arrays as values for the original grids.
(default: interp_file)
dfunc (function/interpolation object) - Function that describes the derivative of the profile with
respect to x. Can be given as an interpolation object. If None, a
generic central difference is taken & interpolated with a
spline of which the order can be chosen.
(default: None)
order (int) - Order of the spline interpolation of the derivative. Default is
cubic. Not used for the interpolation if func returns an
interpolation object. Use read_order in that case.
(default: 3)
args (tuple) - Additional parameters passed to the functions when eval or diff
are called.
(default: [])
kwargs (dict) - Additional keywords passed to the functions when eval or diff are
called.
(default: {})
- Overrides:
object.__init__
|