yt.data_objects.construction_data_containers.YTQuadTreeProjBase

class yt.data_objects.construction_data_containers.YTQuadTreeProjBase(field, axis, weight_field=None, center=None, ds=None, data_source=None, style=None, method='integrate', field_parameters=None)[source]

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

This object is typically accessed through the proj object that hangs off of index objects. YTQuadTreeProj is a projection of a field along an axis. The field can have an associated weight_field, in which case the values are multiplied by a weight before being summed, and then divided by the sum of that weight; the two fundamental modes of operating are direct line integral (no weighting) and average along a line of sight (weighting.) What makes proj different from the standard projection mechanism is that it utilizes a quadtree data structure, rather than the old mechanism for projections. It will not run in parallel, but serial runs should be substantially faster. Note also that lines of sight are integrated at every projected finest-level cell.

Parameters:

field : string

This is the field which will be “projected” along the axis. If multiple are specified (in a list) they will all be projected in the first pass.

axis : int

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

weight_field : string

If supplied, the field being projected will be multiplied by this weight value before being integrated, and at the conclusion of the projection the resultant values will be divided by the projected weight_field.

center : array_like, optional

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

data_source : yt.data_objects.data_containers.YTSelectionContainer, optional

If specified, this will be the data source used for selecting regions to project.

method : string, optional

The method of projection to be performed. “integrate” : integration along the axis “mip” : maximum intensity projection “sum” : same as “integrate”, except that we don’t multiply by the path length WARNING: The “sum” option should only be used for uniform resolution grid datasets, as other datasets may result in unphysical images.

style : string, optional

The same as the method keyword. Deprecated as of version 3.0.2. Please use method keyword instead.

field_parameters : dict of items

Values to be passed as field parameters that can be accessed by generated fields.

Examples

>>> ds = load("RedshiftOutput0005")
>>> prj = ds.proj("density", 0)
>>> print proj["density"]

Attributes

Methods