retrieving position_start and position_end from "my_ray.h5" files

19 views
Skip to first unread message

f...@astro.utoronto.ca

unread,
Jun 5, 2018, 11:36:59 AM6/5/18
to trident-project-users
Hi everyone,

I forgot to save the start and end positions when I generated LightRays. Now I am trying to understand the result, and need to know which LOS created which absorption feature. Is there a way to retrieve position_start and position_end from the "my_ray.h5" files?

Thanks,
Fei Li

Cameron Hummels

unread,
Jun 5, 2018, 12:02:07 PM6/5/18
to f...@astro.utoronto.ca, trident-project-users
Hi Fei,

No problem--the metadata used to generate the rays are stored as attributes in the ray HDF5 files.  You can see this metadata a few ways.  You can look at the HDF5 attributes in the datafile itself:

import h5py
f = h5py.File('ray.h5')
print(f.attrs['light_ray_solution_start'], f.attrs['light_ray_solution_end'])

Or more easily, you can use yt to do it for you:

import yt
ds = yt.load('ray.h5')
print(ds.light_ray_solution)

I hope this helps!  I'll try to add this information to our FAQ so others don't run into the same trouble.

Cameron

--
You received this message because you are subscribed to the Google Groups "trident-project-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trident-project-users+unsub...@googlegroups.com.
To post to this group, send email to trident-project-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trident-project-users/a82ad9cb-a719-481f-a32b-7ce249ed08b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Cameron Hummels
NSF Postdoctoral Fellow
Department of Astronomy
California Institute of Technology
Reply all
Reply to author
Forward
0 new messages