[yt-users] Problem in accessing ramses data
Junhwan Choi (최준환)
choi.junhwan at gmail.com
Mon Nov 25 11:31:01 PST 2013
Hi yt user,
Here I try to make some plots with centering to the densest cell using
following script:
=====================
from yt.mods import *
ds = load("/lustre/widow2/proj/ast031/test11_rhd_fesc=0.05/output_00048/info_00048.txt",
fields = ["Density","x-velocity", "y-velocity",
"z-velocity","Pressure","Metallicity","HI"])
center = ds.h.find_max("Density")[1]
pw = ProjectionPlot(ds, "x", "Density", weight_field="Density", center=center)
pw.zoom(1.01)
pw.save("allviewGas")
pw = ProjectionPlot(ds, "y", "Density", weight_field="Density", center=center)
pw.zoom(1.01)
pw.save("allviewGas")
pw = ProjectionPlot(ds, "z", "Density" , weight_field="Density", center=center)
pw.zoom(1.01)
pw.save("allviewGas")
=====================
and, I got the following error message
File "VisFrame.py", line 4, in <module>
den_center = ds.h.find_max("Density")[1]
File "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/geometry/oct_geometry_handler.py",
line 59, in find_max
mv, pos = self.find_max_cell_location(field, finest_levels)
File "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/geometry/oct_geometry_handler.py",
line 69, in find_max_cell_location
source.quantities["MaxLocation"](field)
File "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/derived_quantities.py",
line 79, in __call__
return self.c_func(self._data_source, *retvals)
File "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/derived_quantities.py",
line 666, in _combMaxLocation
i = np.argmax(args[0]) # ma is arg[0]
File "/ccs/home/jhchoi/common/lib/python2.7/site-packages/numpy/core/fromnumeric.py",
line 738, in argmax
return argmax(axis)
ValueError: attempt to get argmax of an empty sequence
In order to check whether the simulation Density output is messed up,
I replace "center = ds.h.find_max("Density")[1]" to "center=[0,0,0]",
then I am able to make Density projection.
This test suggest that the Density output in the simulation is
alright, but the "ds.h.find_max("Density")[1]" has problem.
Does anyone know how to resolve it?
Thank you in advance,
Junhwan
More information about the yt-users
mailing list