yt.visualization.volume_rendering.transfer_functions.TransferFunction.add_gaussian

TransferFunction.add_gaussian(location, width, height)[source]

Add a Gaussian distribution to the transfer function.

Typically, when rendering isocontours, a Guassian distribution is the easiest way to draw out features. The spread provides a softness. The values are calculated as f(x) = h \exp{-(x-x_0)^2 / w}.

Parameters:

location : float

The centroid of the Gaussian (x_0 in the above equation.)

width : float

The relative width (w in the above equation.)

height : float

The peak height (h in the above equation.) Note that while values greater 1.0 will be accepted, the values of the transmission function are clipped at 1.0.

Examples

>>> tf = TransferFunction( (-10.0, -5.0) )
>>> tf.add_gaussian(-9.0, 0.01, 1.0)