[yt-users] ghost zone validator issue.
Andrew Cunningham
ajc4 at pas.rochester.edu
Fri Sep 20 22:57:26 PDT 2013
Please ignore this thread. I've found the problem. It was not
yt-related.
Thanks.
On Fri, 20 Sep 2013, Andrew Cunningham wrote:
> I'm trying to compute d/dx(gravitational-potential) following the divergence
> of velocity cookbook recepie in the trunk version of yt-2.5. However, when I
> do this the data reader tries to read past the end of the dataset in the
> chombo file. Do others see similar behavior with output from other codes or
> do I have a chombo-specific issue here?
>
>
> # computes unlimited centered difference
> def unlimited(right,center,left):
> return 0.5*(right-left)
>
> def _Gx(field, data):
> sl_left = slice(None,-2,None)
> sl_right = slice(2,None,None)
> ds = data['dx'].flat[0]
> out = np.zeros(data['gravitational-potential'].shape, dtype='float64')
> out[1:-1,1:-1,1:-1] =
> -unlimited(data['gravitational-potential'][sl_right,1:-1,1:-1],data['gravitational-potential'][1:-1,1:-1,1:-1],data['gravitational-potential'][sl_left
> ,1:-1,1:-1])/ds
> return out
> add_field('Gx', function=_Gx,
> validators=[ValidateSpatial(ghost_zones=1,fields=['gravitational-potential'])],
> take_log=False)
>
>
> Traceback (most recent call last):
> File "GradPhy.py", line 48, in <module>
> off = OffAxisSlicePlot(pf, [0,0,1], "Gx", center=center, width=(1000,
> "au"))
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 1454, in
> __init__
> oblique=True, fontsize=fontsize)
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 784, in
> __init__
> PWViewer.__init__(self, *args, **kwargs)
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 591, in
> __init__
> PlotWindow.__init__(self, *args,**kwargs)
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 307, in
> __init__
> self.set_window(bounds) # this automatically updates the data and plot
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 76, in
> newfunc
> args[0]._recreate_frb()
> File "/home/acunning/yt/yt/visualization/plot_window.py", line 359, in
> _recreate_frb
> self._frb._get_data_source_fields()
> File "/home/acunning/yt/yt/visualization/fixed_resolution.py", line 138, in
> _get_data_source_fields
> self[f]
> File "/home/acunning/yt/yt/visualization/fixed_resolution.py", line 424, in
> __getitem__
> self.data_source[item],
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 318, in
> __getitem__
> self.get_data(key)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 845, in
> get_data
> if self._generate_field(field):
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 345, in
> _generate_field
> self._generate_field_in_grids(field, ngt_exception.ghost_zones)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 355, in
> _generate_field_in_grids
> grid[field] = self.__touch_grid_field(grid, field)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 81, in
> save_state
> tr = func(self, grid, field, *args, **kwargs)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 359, in
> __touch_grid_field
> return grid[field]
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 147, in
> __getitem__
> self.get_data(key)
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 190, in
> get_data
> self._generate_field(field)
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 130, in
> _generate_field
> gz_grid = self.retrieve_ghost_zones(n_gz, f_gz, smoothed=True)
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 467, in
> retrieve_ghost_zones
> level, new_left_edge, **kwargs)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3856, in
> __init__
> AMRCoveringGridBase.__init__(self, *args, **kwargs)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3700, in
> __init__
> self._refresh_data()
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3717, in
> _refresh_data
> AMR3DData._refresh_data(self)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 306, in
> _refresh_data
> self.get_data()
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3909, in
> get_data
> self._get_data_from_grid(grid, fields_to_get)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 96, in
> save_state
> tr = func(self, grid, field, *args, **kwargs)
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3970, in
> _get_data_from_grid
> else gf for gf in (grid[field] for field in fields)]
> File "/home/acunning/yt/yt/data_objects/data_containers.py", line 3970, in
> <genexpr>
> else gf for gf in (grid[field] for field in fields)]
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 147, in
> __getitem__
> self.get_data(key)
> File "/home/acunning/yt/yt/data_objects/grid_patch.py", line 180, in
> get_data
> temp = self.hierarchy.io.pop(self, field)
> File "/home/acunning/yt/yt/utilities/io_handler.py", line 53, in pop
> return self._read_data_set(grid, field)
> File "/home/acunning/yt/yt/utilities/io_handler.py", line 82, in
> _read_data_set
> return self._read_data(grid, field)
> File "/home/acunning/yt/yt/frontends/chombo/io.py", line 62, in _read_data
> data = lev[self._data_string][start:stop]
> File
> "/usr/lib64/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/highlevel.py",
> line 1207, in __getitem__
> selection = sel.select(self.shape, args, dsid=self.id)
> File
> "/usr/lib64/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/selections.py",
> line 94, in select
> sel[args]
> File
> "/usr/lib64/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/selections.py",
> line 261, in __getitem__
> start, count, step, scalar = _handle_simple(self.shape,args)
> File
> "/usr/lib64/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/selections.py",
> line 512, in _handle_simple
> x,y,z = _translate_slice(arg, length)
> File
> "/usr/lib64/python2.6/site-packages/h5py-1.3.1-py2.6-linux-x86_64.egg/h5py/selections.py",
> line 562, in _translate_slice
> raise ValueError("Start index %s out of range (0-%d)" % (start,
> length-1))
> ValueError: Start index 10665984 out of range (0-10665983)
> _______________________________________________
> 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