yt.data_objects.selection_data_containers.YTSliceBase

class yt.data_objects.selection_data_containers.YTSliceBase(axis, coord, center=None, ds=None, field_parameters=None, data_source=None)[source]

This is a data object corresponding to a slice through the simulation domain.

This object is typically accessed through the slice object that hangs off of index objects. Slice is an orthogonal slice through the data, taking all the points at the finest resolution available and then indexing them. It is more appropriately thought of as a slice ‘operator’ than an object, however, as its field and coordinate can both change.

Parameters:

axis : int or char

The axis along which to slice. Can be 0, 1, or 2 for x, y, z.

coord : float

The coordinate along the axis at which to slice. This is in “domain” coordinates.

center : array_like, optional

The ‘center’ supplied to fields that use it. Note that this does not have to have coord as one value. optional.

ds: Dataset, optional :

An optional dataset to use rather than self.ds

field_parameters : dictionary

A dictionary of field parameters than can be accessed by derived fields.

data_source: optional :

Draw the selection from the provided data source rather than all data associated with the data_set

Examples

>>> import yt
>>> ds = yt.load("RedshiftOutput0005")
>>> slice = ds.slice(0, 0.25)
>>> print slice["Density"]

Attributes

Methods