spacepy.pybats.bats.Stream

class spacepy.pybats.bats.Stream(bats, xstart, ystart, xfield, yfield, style='mag', type='streamline', method='rk4', var_list='all', extract=False, maxPoints=20000, *args, **kwargs)[source]

A class for streamlines. Contains all of the information about the streamline, including extracted variables.

Upon instantiation, the object will trace through the vector field determined by the “[x/y]field” values and the Bats object “bats”.

Parameters:
batsBats

Bats2d object through which to trace.

xstartfloat

X value of location to start the trace.

ystartfloat

Y value of location to start the trace.

xfieldstr

Name of variable in bats which contains X values of the field

yfieldstr

Name of variable in bats which contains Y values of the field

Other Parameters:
stylestr

Sets line style, including colors. See set_style() for details. (Default ‘mag’)

typestr

(Default ‘streamline’)

methodstr

Integration method. The default is Runge-Kutta 4 (‘rk4’) which gives a good blend of speed and accuracy. See the test functions in trace2d for more info. The other option is a simple Euler’s method approach (‘eul’). (Default ‘rk4’)

extractbool

(Default: False) Extract variables along stream trace and save within object.

maxPointsint

(Default : 20000) Maximum number of integration steps to take.

var_liststring or sequence of strings

(Default : ‘all’) List of values to extract from dataset. Defaults to ‘all’, for all values within bats.

Notes

Methods

set_style(style)

Set the line style either using a simple matplotlib-type style string or using a preset style type.

treetrace(bats[, maxPoints])

Trace through the vector field using the quad tree.

trace(bats)

Trace through the vector field.

plot(ax, *args, **kwargs)

Add streamline to axes object "ax".

set_style(style)[source]

Set the line style either using a simple matplotlib-type style string or using a preset style type. Current types include:

‘mag’treat line as a magnetic field line. Closed lines are

white, other lines are black.

treetrace(bats, maxPoints=20000)[source]

Trace through the vector field using the quad tree.

trace(bats)[source]

Trace through the vector field.

plot(ax, *args, **kwargs)[source]

Add streamline to axes object “ax”.