Closed clairekope closed 3 years ago
Hi @clairekope . These data are already stored in the ray
object. You can access them by looking at ds.light_ray_solution
:
In [1]: ds.light_ray_solution
Out[1]:
[{'end': unyt_array([1., 1., 1.], 'unitary'),
'filename': 'snapshot_600.hdf5',
'redshift': 0.05,
'start': unyt_array([0.48810148, 0.51748806, 0.54316002], 'unitary'),
'traversal_box_fraction': unyt_quantity(0.83878521, 'unitary'),
'unique_identifier': '1436307563512020127'}]
I'll try to make this easier to find in the docs, though.
I'll leave this PR open until I've updated the docs sufficiently.
Fixed in PR #175 .
Awesome! I didn't see this metadata with h5ls
so I thought it didn't exist. Thanks for updating the docs!
No worries! It was sneaky in there. I actually started to implement your request and then realized it was already there, so I even fooled myself!
It'd be nice for rays to store their start and end coordinates as HDF5 attributes. In the past I have randomly generated sets of starts and ends but not saved them, so I'd have to try to recreate the start and end coordinates from the ray's position fields. I've run into weird bugs with this, and it'd be easier to just store this kind of metadata as attributes. There's probably more metadata associated with compound rays, but I've not ever worked with those. This should be easy to do through the
extra_attrs
argument in yt'ssave_as_dataset
.