Package topo :: Package patterns :: Module basic :: Class Gaussian
[hide private]
[frames] | no frames]

Class Gaussian

source code

                                  object --+        
                                           |        
base.parameterizedobject.ParameterizedObject --+    
                                               |    
          base.patterngenerator.PatternGenerator --+
                                                   |
                                                  Gaussian

2D Gaussian pattern generator.

The sigmas of the Gaussian are calculated from the size and aspect_ratio parameters:

ysigma=size/2 xsigma=ysigma*aspect_ratio

The Gaussian is then computed for the given (x,y) values as:

exp(-x^2/(2*xsigma^2) - y^2/(2*ysigma^2)


Nested Classes [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: __metaclass__

Instance Methods [hide private]
 
function(self, params)
Function to draw a pattern that will then be scaled and rotated.
source code

Inherited from base.patterngenerator.PatternGenerator: __call__

Inherited from base.parameterizedobject.ParameterizedObject: __getstate__, __init__, __repr__, __setstate__, __str__, as_uninitialized, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, verbose, warning

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: params, print_param_defaults

Class Variables [hide private]
  aspect_ratio = <topo.base.parameterclasses.Number object at 0x...
Ratio of the width to the height.
  size = Number(default= 0.5, doc= ...
Overall size of the Gaussian, defined by: exp(-x^2/(2*xsigma^2) - y^2/(2*ysigma^2) where ysigma=size/2 and xsigma=size/2*aspect_ratio.
  __params = {'aspect_ratio': <topo.base.parameterclasses.Number...
dict() -> new empty dictionary.

Inherited from base.patterngenerator.PatternGenerator: bounds, mask, offset, orientation, output_fn, position, scale, x, xdensity, y, ydensity

Inherited from base.parameterizedobject.ParameterizedObject: name, print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

function(self, params)

source code 

Function to draw a pattern that will then be scaled and rotated.

Instead of implementing __call__ directly, PatternGenerator subclasses will typically implement this helper function used by __call__, because that way they can let __call__ handle the scaling and rotation for them. Alternatively, __call__ itself can be reimplemented entirely by a subclass (e.g. if it does not need to do any scaling or rotation), in which case this function will be ignored.

Overrides: base.patterngenerator.PatternGenerator.function
(inherited documentation)

Class Variable Details [hide private]

aspect_ratio

Ratio of the width to the height. Specifically, xsigma=ysigma*aspect_ratio (see size).
Value:
Number(default= 0.3, bounds= (0.0, None), softbounds= (0.0, 2.0), precedence= 0.31\
, doc= """
        Ratio of the width to the height.
        Specifically, xsigma=ysigma*aspect_ratio (see size).
        """)

size

Overall size of the Gaussian, defined by: exp(-x^2/(2*xsigma^2) - y^2/(2*ysigma^2) where ysigma=size/2 and xsigma=size/2*aspect_ratio.
Value:
Number(default= 0.5, doc= """
        Overall size of the Gaussian, defined by:
        exp(-x^2/(2*xsigma^2) - y^2/(2*ysigma^2)
        where ysigma=size/2 and xsigma=size/2*aspect_ratio.
        """)

__params

dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
    d = {}
    for k, v in seq:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

Value:
{'aspect_ratio': <topo.base.parameterclasses.Number object at 0x9dae7ac>,
 'bounds': <topo.base.boundingregion.BoundingRegionParameter object at 0x9d7d764>,
 'mask': <topo.base.parameterizedobject.Parameter object at 0x9d7d844>,
 'name': <topo.base.parameterizedobject.Parameter object at 0x98cb02c>,
 'offset': <topo.base.parameterclasses.Number object at 0x9d6bbec>,
 'orientation': <topo.base.parameterclasses.Number object at 0x9d6bb2c>,
 'output_fn': <topo.base.parameterclasses.ClassSelectorParameter object at 0x9d7da\
04>,
...