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
coords : tuple of floats
ds: Dataset, optional :
field_parameters : dictionary
data_source: optional :
|
---|
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