class yt.data_objects.construction_data_containers.YTQuadTreeProj(field, axis, weight_field=None, center=None, ds=None, data_source=None, style=None, method='integrate', field_parameters=None, max_level=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.

  • 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.


>>> ds = load("RedshiftOutput0005")
>>> prj = ds.proj("density", 0)
>>> print proj["density"]
__init__(field, axis[, weight_field, ...])
apply_units(arr, units)
argmax(field[, axis]) Return the values at which the field is maximized.
argmin(field[, axis]) Return the values at which the field is minimized.
chunks(fields, chunking_style, **kwargs)
clear_data() Clears out all data from the YTDataContainer instance, freeing memory.
convert(datatype) This will attempt to convert a given unit to cgs from code units.
get_field_parameter(name[, default]) This is typically only used by derived field functions, but it returns parameters used to generate fields.
has_field_parameter(name) Checks if a field parameter is set.
has_key(key) Checks if a data field already exists.
hist(field[, weight, bins])
integrate(field[, axis]) Compute the integral (projection) of a field along an axis.
max(field[, axis]) Compute the maximum of a field, optionally along an axis.
mean(field[, axis, weight]) Compute the mean of a field, optionally along an axis, with a weight.
min(field[, axis]) Compute the minimum of a field.
partition_index_3d(ds[, padding, rank_ratio])
partition_index_3d_bisection_list() Returns an array that is used to drive _partition_index_3d_bisection, below.
partition_region_3d(left_edge, right_edge[, ...]) Given a region, it subdivides it into smaller regions for parallel analysis.
ptp(field) Compute the range of values (maximum - minimum) of a field.
save_as_dataset([filename, fields]) Export a data object to a reloadable yt dataset.
save_object(name[, filename]) Save an object.
set_field_parameter(name, val) Here we set up dictionaries that get passed up and down and ultimately to derived fields.
std(field[, weight])
sum(field[, axis]) Compute the sum of a field, optionally along an axis.
to_dataframe([fields]) Export a data object to a pandas DataFrame.
to_frb(width, resolution[, center, height, ...]) This function returns a FixedResolutionBuffer generated from this object.
to_glue(fields[, label, data_collection]) Takes specific fields in the container and exports them to Glue ( for interactive analysis.
to_pw([fields, center, width, origin]) Create a PWViewerMPL from this object.
write_out(filename[, fields, format])