working with general hdf5 data from galaxy simulations
Hello all, yt has some of the greatest plotting capabilities, and I greatly enjoy working with yt! Recently I have begun to work with hdf5 data from a large scale galaxy simulation (illustris) and I was wondering how I can work with the data, is there a general munging procedure for getting it into the correct yt format? When I try to plot import yt ds = yt.load("Groups_hdf5_plt_cnt_0150") yt.SlicePlot(ds, 'x', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'y', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'z', "density", width = (800.0, 'kpc')).save() I get the following error: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yt/frontends/gadget_fof/data_structures.pyc in _parse_parameter_file(self) * 151* self.periodicity = (True, True, True) * 152* self.current_redshift = hvals["Redshift"] --> 153 self.omega_lambda = hvals["OmegaLambda"] * 154* self.omega_matter = hvals["Omega0"] * 155* self.hubble_constant = hvals["HubbleParam"] KeyError: 'OmegaLambda' I am guessing this is because the field entries do not match up. Any help is much appreciated! Dan
Hi Dan,
This means that yt isn't able to infer cosmological parameters for that
dataset. It looks like you're trying to load a groups file, which is a
subset of the full dataset, and it's being read in by the Gadget FOF
frontend, which handles group datasets like this for the Gadget simulation
code. Arepo and Gadget are supposed to share identical output formats, but
it looks like the groups file you're trying to load is subtly different
from the sorts of Gadget groups files that yt can already natively load.
Looking at the Gadget FOF frontend, there doesn't appear to be a way to set
cosmology parameters by hand. I think the best approach here is probably to
modify the Gadget FOF frontend to handle Arepo data.
Unfortunately I don't know much about the Gadget FOF frontend - Britton
Smith is the author of that frontend and he may be able to chime in here.
-Nathan
On Mon, Feb 22, 2016 at 1:16 AM, D Mick
Hello all, yt has some of the greatest plotting capabilities, and I greatly enjoy working with yt! Recently I have begun to work with hdf5 data from a large scale galaxy simulation (illustris) and I was wondering how I can work with the data, is there a general munging procedure for getting it into the correct yt format? When I try to plot
import yt
ds = yt.load("Groups_hdf5_plt_cnt_0150") yt.SlicePlot(ds, 'x', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'y', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'z', "density", width = (800.0, 'kpc')).save()
I get the following error:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yt/frontends/gadget_fof/data_structures.pyc in _parse_parameter_file(self)
* 151* self.periodicity = (True, True, True)
* 152* self.current_redshift = hvals["Redshift"]
--> 153 self.omega_lambda = hvals["OmegaLambda"]
* 154* self.omega_matter = hvals["Omega0"]
* 155* self.hubble_constant = hvals["HubbleParam"]
KeyError: 'OmegaLambda'
I am guessing this is because the field entries do not match up.
Any help is much appreciated!
Dan
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Dan,
I did indeed write the frontend for Gadget FOF catalogs and I would be glad
to help you get your data loaded in.
For Gadget FOF datasets, all of the cosmological parameters are stored as
hdf5 attributes in a group called Header. In the bit of code you posted,
hvals is a dictionary containing all of the hdf5 attributes read in from
the Header group. It's possible that the name of the attribute storing
omega_lambda has simply been changed from OmegaLambda to something else.
Variable name changes have been known to happen in the Gadget codebase, so
it's definitely possible.
If this is all it is, then what we should do is alter this frontend to try
a few different names to get the various cosmological parameters. That
should be quite easy to do and I could show you where to make the necessary
changes and you could issue a pull request. If there are further
differences, it may be best to create a new frontend specifically for this
data type. I can't imagine there would be huge differences in the data
format, so this shouldn't be too hard either. If you were able to provide
me with a sample dataset to test against, I would be happy to look at this.
Britton
On Mon, Feb 22, 2016 at 3:23 PM, Nathan Goldbaum
Hi Dan,
This means that yt isn't able to infer cosmological parameters for that dataset. It looks like you're trying to load a groups file, which is a subset of the full dataset, and it's being read in by the Gadget FOF frontend, which handles group datasets like this for the Gadget simulation code. Arepo and Gadget are supposed to share identical output formats, but it looks like the groups file you're trying to load is subtly different from the sorts of Gadget groups files that yt can already natively load.
Looking at the Gadget FOF frontend, there doesn't appear to be a way to set cosmology parameters by hand. I think the best approach here is probably to modify the Gadget FOF frontend to handle Arepo data.
Unfortunately I don't know much about the Gadget FOF frontend - Britton Smith is the author of that frontend and he may be able to chime in here.
-Nathan
On Mon, Feb 22, 2016 at 1:16 AM, D Mick
wrote: Hello all, yt has some of the greatest plotting capabilities, and I greatly enjoy working with yt! Recently I have begun to work with hdf5 data from a large scale galaxy simulation (illustris) and I was wondering how I can work with the data, is there a general munging procedure for getting it into the correct yt format? When I try to plot
import yt
ds = yt.load("Groups_hdf5_plt_cnt_0150") yt.SlicePlot(ds, 'x', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'y', "density", width = (800.0, 'kpc')).save() yt.SlicePlot(ds, 'z', "density", width = (800.0, 'kpc')).save()
I get the following error:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/yt/frontends/gadget_fof/data_structures.pyc in _parse_parameter_file(self)
* 151* self.periodicity = (True, True, True)
* 152* self.current_redshift = hvals["Redshift"]
--> 153 self.omega_lambda = hvals["OmegaLambda"]
* 154* self.omega_matter = hvals["Omega0"]
* 155* self.hubble_constant = hvals["HubbleParam"]
KeyError: 'OmegaLambda'
I am guessing this is because the field entries do not match up.
Any help is much appreciated!
Dan
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
Britton Smith
-
D Mick
-
Nathan Goldbaum