Hi Dave,
(Nice to hear from you!) Yes, it's possible, although I have a
suspicion why you want to. ;-) You can do this with h5py much more
easily:
import h5py
f = h5py.File("something", "w")
f.create_dataset("/density", cg["Density"])
f.close()
If you do it with cg["density"] it'll be in CGS, not code units.
-Matt
On Tue, Oct 20, 2015 at 10:30 AM, Dave Semeraro
Hello,
I have created a covering grid from a sample Enzo dataset. I would like to write the “density” field to a file. I am doing the following but getting an error.
cg = ds.covering_grid(3,[0.,0.,0.],ds.domain_dimensions*2**2)
cg.write_out("spoot","Density")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/work/01197/semeraro/maverick/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py", line 399, in write_out
field_data = np.array([self.field_data[field] for field in field_order])
KeyError: 'x'
Is it possible to write out the single field to a file from a covering grid?
DAve
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org