Hi Daniel,

You can use the ray object like other geometric data containers in yt to
query fields for all the cells/particles intersected by the ray. For
example,
ray = ds.ray(...)
print (ray("gas", "density"))
print (ray("index", "x")) # x position

You can also use the annotate_ray
<https://yt-project.org/docs/dev/visualizing/callbacks.html#annotate_ray>
function to overplot your ray onto projects, slices, etc.

Britton

On Fri, Jun 7, 2024 at 8:42 PM Daniel <[email protected]> wrote:

> Hello my name is Daniel, I have been working with yt for a couple months
> and it has been really useful. I have found the ray method very useful but
> I have been wondering if there was a possibility to be able to print out a
> ray like an array. What I mean is if there is a way to use a ray to grab
> information along that ray and be able to iterate through it like an array
> to be able to print it out into a file or just print in general. If this is
> not possible is there any other method I should use to be able to get a
> line of information between two points and be able to print it out
> somewhere? Also if possible I would also like it to be able to annotate it
> on a graph like a ray so I can see where exactly I'm grabbing but if not
> that is fine.
>
> Thank you,
> Daniel
> _______________________________________________
> yt-users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/yt-users.python.org/
> Member address: [email protected]
>
_______________________________________________
yt-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: [email protected]

Reply via email to