yt.extensions.volume_rendering.TransferFunction.add_step

TransferFunction.add_step(start, stop, value)

Adds a step function to the transfer function.

This accepts a start and a stop, and then in between those points the transfer function is set to the maximum of the transfer function and the value.

Parameters :

start : float

This is the beginning of the step function; must be within domain of the transfer function.

stop : float

This is the ending of the step function; must be within domain of the transfer function.

value : float

The value the transfer function will be set to between start and stop. Note that the transfer function will actually be set to max(y, value) where y is the existing value of the transfer function.

Examples

Note that in this example, we have added a step function, but the Gaussian that already exists will “win” where it exceeds 0.5.

>>> tf = TransferFunction( (-10.0, -5.0) )
>>> tf.add_gaussian(-7.0, 0.01, 1.0)
>>> tf.add_step(-8.0, -6.0, 0.5)

Previous topic

yt.extensions.volume_rendering.TransferFunction.add_line

Next topic

yt.extensions.volume_rendering.TransferFunction.plot

This Page