[yt-users] Problem in accessing ramses data
Junhwan Choi (최준환)
choi.junhwan at gmail.com
Mon Nov 25 14:29:47 PST 2013
Thank you Matt,
The simulation I am dealing with is the uni-grid simulation.
I set finest_levels=top_grid level, now the find_max works.
Best wish,
Junhwan
On Mon, Nov 25, 2013 at 1:34 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi Junhwan,
>
> On Mon, Nov 25, 2013 at 2:31 PM, Junhwan Choi (최준환)
> <choi.junhwan at gmail.com> wrote:
>> 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?
>
> That's weird; I am able to do find_max here just fine. I suspect that
> the issue might be related to the finest_levels argument. What
> happens if you do:
>
> pf.h.find_max("Density", finest_levels=30)
>
> -Matt
>
>>
>> Thank you in advance,
>> Junhwan
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
More information about the yt-users
mailing list