Package topo :: Package misc :: Module patternfn
[hide private]
[frames] | no frames]

Module patternfn

source code


Version: $Revision: 11295 $

Functions [hide private]
 
float_error_ignore(*args, **kwds)
Many of the functions in this module use Gaussian smoothing, which is based on a calculation like exp(divide(x*x,sigma)).
source code
 
gaussian(x, y, xsigma, ysigma)
Two-dimensional oriented Gaussian pattern (i.e., 2D version of a bell curve, like a normal distribution but not necessarily summing to 1.0).
source code
 
sigmoid(axis, slope)
Sigmoid dividing axis into a positive and negative half, with a smoothly sloping transition between them (controlled by the slope).
source code
 
exponential(x, y, xscale, yscale)
Two-dimensional oriented exponential decay pattern.
source code
 
gabor(x, y, xsigma, ysigma, frequency, phase)
Gabor pattern (sine grating multiplied by a circular Gaussian).
source code
 
line(y, thickness, gaussian_width)
Infinite-length line with a solid central region, then Gaussian fall-off at the edges.
source code
 
disk(x, y, height, gaussian_width)
Circular disk with Gaussian fall-off after the solid central region.
source code
 
ring(x, y, height, thickness, gaussian_width)
Circular ring (annulus) with Gaussian fall-off after the solid ring-shaped region.
source code
 
smooth_rectangle(x, y, rec_w, rec_h, gaussian_width_x, gaussian_width_y)
Rectangle with a solid central region, then Gaussian fall-off at the edges.
source code
 
arc_by_radian(x, y, height, radian_range, thickness, gaussian_width)
Radial arc with Gaussian fall-off after the solid ring-shaped region with the given thickness, with shape specified by the (start,end) radian_range.
source code
 
arc_by_center(x, y, arc_box, constant_length, thickness, gaussian_width)
Arc with Gaussian fall-off after the solid ring-shaped region and specified by point of tangency (x and y) and arc width and height.
source code
Variables [hide private]
  __package__ = 'topo.misc'
Function Details [hide private]

float_error_ignore(*args, **kwds)

source code 
Many of the functions in this module use Gaussian smoothing, which is based on a calculation like exp(divide(x*x,sigma)). When sigma is zero the value of this expression should be zero at all points in the plane, because such a Gaussian is infinitely small. Obtaining the correct answer using finite-precision floating-point array computations requires allowing infinite values to be returned from divide(), and allowing exp() to underflow silently to zero when given an infinite value. In numpy this is achieved by using its seterr() function to disable divide-by-zero and underflow warnings temporarily while these values are being computed.
Decorators:
  • @contextmanager

sigmoid(axis, slope)

source code 

Sigmoid dividing axis into a positive and negative half, with a smoothly sloping transition between them (controlled by the slope).

At default rotation, axis refers to the vertical (y) axis.

arc_by_center(x, y, arc_box, constant_length, thickness, gaussian_width)

source code 

Arc with Gaussian fall-off after the solid ring-shaped region and specified by point of tangency (x and y) and arc width and height.

This function calculates the start and end radian from the given width and height, and then calls arc_by_radian function to draw the curve.