yt.data_objects.selection_data_containers.YTOrthoRayBase

class yt.data_objects.selection_data_containers.YTOrthoRayBase(axis, coords, ds=None, field_parameters=None, data_source=None)[source]

This is an orthogonal ray cast through the entire domain, at a specific coordinate.

This object is typically accessed through the ortho_ray object that hangs off of index objects. The resulting arrays have their dimensionality reduced to one, and an ordered list of points at an (x,y) tuple along axis are available.

Parameters:

axis : int

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

coords : tuple of floats

The (plane_x, plane_y) coordinates at which to cast the ray. Note that this is in the plane coordinates: so if you are casting along x, this will be (y,z). If you are casting along y, this will be (x,z). If you are casting along z, this will be (x,y).

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")
>>> oray = ds.ortho_ray(0, (0.2, 0.74))
>>> print oray["Density"]

Note: The low-level data representation for rays are not guaranteed to be spatially ordered. In particular, with AMR datasets, higher resolution data is tagged on to the end of the ray. If you want this data represented in a spatially ordered manner, manually sort it by the “t” field, which is the value of the parametric variable that goes from 0 at the start of the ray to 1 at the end:

>>> my_ray = ds.ortho_ray(...)
>>> ray_sort = np.argsort(my_ray["t"])
>>> density = my_ray["density"][ray_sort]

Attributes

Methods