[yt-users] pf.h.region error

Elizabeth Tasker tasker at astro1.sci.hokudai.ac.jp
Wed Feb 22 11:21:41 PST 2012


(As an amendment, it throws the same error when trying to create a
projection of the whole data set:

p = pc.add_projection("Density", 0) )

Elizabeth



On 22 February 2012 14:10, Elizabeth Tasker
<tasker at astro1.sci.hokudai.ac.jp> wrote:
> Occasionally, when I try and create a region, I get this error;
>
>
>
> ValueError                                Traceback (most recent call last)
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/scripts/iyt in <module>()
>     20 pc = PlotCollection(pf, center=center)
>     21
> ---> 22 reg = pf.h.region(center, [center[0]-0.5*width,
> center[1]-0.5*width, center[2]-0.5*depth], [center[0]+0.5*width,
> center[1]+0.5*width, center[2]+0.5*dept
> h])
>     23
>     24 p = pc.add_projection('Density', 2, data_source=reg)
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/data_objects/static_output.pyc
> in hierarchy(self)
>    167                 raise RuntimeError("You should not instantiate
> StaticOutput.")
>    168             self._instantiated_hierarchy =
> self._hierarchy_class(
> --> 169                 self, data_style=self.data_style)
>    170         return self._instantiated_hierarchy
>    171     h = hierarchy  # alias
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc
> in __init__(self, pf, data_style)
>    160             self.float_type = 'float64'
>    161
> --> 162         AMRHierarchy.__init__(self, pf, data_style)
>    163         # sync it back
>    164         self.parameter_file.data_style = self.data_style
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/data_objects/hierarchy.pyc
> in __init__(self, pf, data_style)
>     68
>     69         mylog.debug("Parsing hierarchy.")
> ---> 70         self._parse_hierarchy()
>     71
>     72         mylog.debug("Constructing grid objects.")
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc
> in _parse_hierarchy(self)
>    226             return line.split()[2:]
>    227         if os.path.exists(self.hierarchy_filename[:-9] + "harrays"):
> --> 228             if self._parse_binary_hierarchy(): return
>    229         t1 = time.time()
>    230         pattern = r"Pointer:
> Grid\[(\d*)\]->NextGrid(Next|This)Level = (\d*)\s+$"
>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc
> in _parse_binary_hierarchy(self)
>    300         except h5py.h5.H5Error:
>    301             return False
> --> 302         self.grid_dimensions[:] = f["/ActiveDimensions"][:]
>    303         self.grid_left_edge[:] = f["/LeftEdges"][:]
>    304         self.grid_right_edge[:] = f["/RightEdges"][:]
>
> ValueError: shape mismatch: objects cannot be broadcast to a single shape
> WARNING: Failure executing file: <image_object.py>
>
>
> What I don't understand is that it'll happen on one data set, but then
> the next one (or the one before) in the simulation will be totally
> fine. My dtdump steps are small too, so I'm confused as to why this
> would occur. Both "width" and "depth" are neither very small or very
> large compared to "centre". (In kpc, centre = 16, 22, 16 and width =
> 4 and depth = 1.)
>
> Elizabeth



More information about the yt-users mailing list