yt.data_objects.construction_data_containers.YTStreamlineBase

class yt.data_objects.construction_data_containers.YTStreamlineBase(positions, length=1.0, fields=None, ds=None, **kwargs)[source]

This is a streamline, which is a set of points defined as being parallel to some vector field.

This object is typically accessed through the Streamlines.path function. The resulting arrays have their dimensionality reduced to one, and an ordered list of points at an (x,y) tuple along axis are available, as is the t field, which corresponds to a unitless measurement along the ray from start to end.

Parameters:

positions : array-like

List of streamline positions

length : float

The magnitude of the distance; dts will be divided by this

fields : list of strings, optional

If you want the object to pre-retrieve a set of fields, supply them here. This is not necessary.

ds : dataset object

Passed in to access the index

kwargs : dict of items

Any additional values are passed as field parameters that can be accessed by generated fields.

Examples

>>> from yt.visualization.api import Streamlines
>>> streamlines = Streamlines(ds, [0.5]*3)
>>> streamlines.integrate_through_volume()
>>> stream = streamlines.path(0)
>>> matplotlib.pylab.semilogy(stream['t'], stream['density'], '-x')

Attributes

Methods