Package ComboCode :: Package cc :: Package modeling :: Package profilers :: Module Profiler :: Class Profiler2D
[hide private]
[frames] | no frames]

Class Profiler2D

source code


An interface for creating 2D profiles, and allowing to evaluate them and calculate the central difference with respect to a 2D coordinate grid.

Instance Methods [hide private]
 
__init__(self, x, y, func, *args, **kwargs)
Create an instance of the Profiler2D() class.
source code
array/float
__call__(self, x=None, y=None, warn=1)
Evaluate the profile function at a coordinate point.
source code
array/float
eval(self, x=None, y=None, warn=1)
Evaluate the profile function at a coordinate point.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, x, y, func, *args, **kwargs)
(Constructor)

source code 

Create an instance of the Profiler2D() class. Requires 2 coordinate arrays and a function object for profile.

The function can also be given as an interpolation object.

The optional args and kwargs give the additional arguments for the function, which are ignored in case func is an interpolation object.

The default coordinate grids are both evaluated for the function. They are saved in self.z, as an array of dimensions (x.size,y.size). Alternatively, new evaluations can be attained through eval and diff.

Parameters:
  • x (array) - The default coordinates of the primary independent variable. Minimum three points.
  • y (array) - The default coordinates of the secondary independent variable. Minimum three points.
  • func (function/interpolation object) - The function that describes the profile with respect to x and y. Can be given as a 2D interpolation object.
  • 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__

__call__(self, x=None, y=None, warn=1)
(Call operator)

source code 

Evaluate the profile function at a coordinate point.

x/y can be any value or array. If func is an interpolation object, it is in principle limited by the x/y-range of the interpolator. It is advised not to extend much beyond the given x/y-range.

If one of the two variables is None, it is replaced by the default grid.

Passes on the call to self.eval().

Parameters:
  • x (array/float) - The primary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • y (array/float) - The secondary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

Returns: array/float
The profile evaluated at x and y

eval(self, x=None, y=None, warn=1)

source code 

Evaluate the profile function at a coordinate point.

x/y can be any value or array. If func is an interpolation object, it is in principle limited by the x/y-range of the interpolator. It is advised not to extend much beyond the given x/y-range.

If one of the two variables is None, it is replaced by the default grid.

Parameters:
  • x (array/float) - The primary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • y (array/float) - The secondary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

Returns: array/float
The profile evaluated at x and y