yt.visualization.volume_rendering.transfer_functions.ColorTransferFunction.add_step

ColorTransferFunction.add_step(start, stop, value)[source]

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 : list of 4 floats

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. This must be a list, and it is in the order of (red, green, blue, alpha).

Examples

This adds a step function that will produce a white value at > -6.0.

>>> tf = ColorTransferFunction( (-10.0, -5.0) )
>>> tf.add_step(-6.0, -5.0, [1.0, 1.0, 1.0, 1.0])