scalar_bidimensional_function#

class arte.types.scalar_bidimensional_function.ScalarBidimensionalFunction(values_array, xmap=None, ymap=None, domain=None)#

Bases: object

Represents a scalar function in an XY plane

The function is initialized with a 2d value and one of the following:
  • a domain over which it is defined

  • two X and Y maps with the domain coordinates

  • (nothing passed) a default domain with the same shape as the value, with centered origin and unitary step

Parameters:
  • values_array (numpy.ndarray) – two-dimensional array with the function value

  • xmap (numpy.ndarray, optional) – two-dimensional array with the X coordinate at which each function value is sampled.

  • ymap (numpy.ndarray, optional) – two-dimensional array with the Y coordinate at which each function value is sampled.

  • domain (DomainXY instance, optional) – the domain over which the function is sampled.

Raises:

ValueError – if the input parameters do not satisfy the requirements, for example: - xmap is passed, but not ymap - both xmap/ymap and a domain has been passed - values_array is not a 2d array - shapes of values and xmap/ymap or domain don’t match

Attributes:
domain

DomainXY instance

shape

(y,x) function shape

values

2d values array

Methods

get_radial_profile()

Get the radial profile around the domain origin.

help([search, prefix])

Interactive help

interpolate_in_xy(x, y[, span])

Interpolate the function at points x,y

get_roi

plot_radial_profile

property domain#

DomainXY instance

get_radial_profile()#

Get the radial profile around the domain origin.

Assumes that the domain sampling is the same in the X and Y directions

get_roi(xmin, xmax, ymin, ymax)#
help(search='', prefix='')#

Interactive help

Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.

The prefix argument is prepended to the method name and is used for recursive help of every class member.

interpolate_in_xy(x, y, span=3)#

Interpolate the function at points x,y

Returns an array of z[i] corresponding to the values interpolated at points x[i], y[i]

The interpolation algorithm is linear and uses a box of 3x3 points centered on the closest point to the interpolation coordinate

Parameters:
  • x (numpy.ndarray or tuple with size N) – 1D array of the x coordinates of the sampling points

  • y (numpy.ndarray or tuple with size N) – 1D array of the y coordinates of the sampling points

Returns:

z – array of shape (N,) of the sampled values. z[i] = interp(f, x[i], y[i])

Return type:

numpy.ndarray

plot_radial_profile()#
property shape#

(y,x) function shape

property values#

2d values array