yt.data_objects.selection_data_containers.YTCutRegionBase

class yt.data_objects.selection_data_containers.YTCutRegionBase(data_source, conditionals, ds=None, field_parameters=None, base_object=None)[source]

This is a data object designed to allow individuals to apply logical operations to fields and filter as a result of those cuts.

Parameters:

data_source : YTSelectionContainer3D

The object to which cuts will be applied.

conditionals : list of strings

A list of conditionals that will be evaluated. In the namespace available, these conditionals will have access to ‘obj’ which is a data object of unknown shape, and they must generate a boolean array. For instance, conditionals = [“obj[‘temperature’] < 1e3”]

Examples

>>> import yt
>>> ds = yt.load("RedshiftOutput0005")
>>> sp = ds.sphere("max", (1.0, 'Mpc'))
>>> cr = ds.cut_region(sp, ["obj['temperature'] < 1e3"])

Attributes

Methods