<p>The problem lies with incorrect harrays files, which get parsed on hierarchy instantiation. Wipe them out and you will be fine. </p>
<p>Adding validation to hierarchy serialization sounds like a good introductory project for any keen new developers. :-) </p>
<div class="gmail_quote">On Feb 22, 2012 2:22 PM, "Elizabeth Tasker" <<a href="mailto:tasker@astro1.sci.hokudai.ac.jp">tasker@astro1.sci.hokudai.ac.jp</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(As an amendment, it throws the same error when trying to create a<br>
projection of the whole data set:<br>
<br>
p = pc.add_projection("Density", 0) )<br>
<br>
Elizabeth<br>
<br>
<br>
<br>
On 22 February 2012 14:10, Elizabeth Tasker<br>
<<a href="mailto:tasker@astro1.sci.hokudai.ac.jp">tasker@astro1.sci.hokudai.ac.jp</a>> wrote:<br>
> Occasionally, when I try and create a region, I get this error;<br>
><br>
><br>
><br>
> ValueError                                Traceback (most recent call last)<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/scripts/iyt in <module>()<br>
>     20 pc = PlotCollection(pf, center=center)<br>
>     21<br>
> ---> 22 reg = pf.h.region(center, [center[0]-0.5*width,<br>
> center[1]-0.5*width, center[2]-0.5*depth], [center[0]+0.5*width,<br>
> center[1]+0.5*width, center[2]+0.5*dept<br>
> h])<br>
>     23<br>
>     24 p = pc.add_projection('Density', 2, data_source=reg)<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/data_objects/static_output.pyc<br>
> in hierarchy(self)<br>
>    167                 raise RuntimeError("You should not instantiate<br>
> StaticOutput.")<br>
>    168             self._instantiated_hierarchy =<br>
> self._hierarchy_class(<br>
> --> 169                 self, data_style=self.data_style)<br>
>    170         return self._instantiated_hierarchy<br>
>    171     h = hierarchy  # alias<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc<br>
> in __init__(self, pf, data_style)<br>
>    160             self.float_type = 'float64'<br>
>    161<br>
> --> 162         AMRHierarchy.__init__(self, pf, data_style)<br>
>    163         # sync it back<br>
>    164         self.parameter_file.data_style = self.data_style<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/data_objects/hierarchy.pyc<br>
> in __init__(self, pf, data_style)<br>
>     68<br>
>     69         mylog.debug("Parsing hierarchy.")<br>
> ---> 70         self._parse_hierarchy()<br>
>     71<br>
>     72         mylog.debug("Constructing grid objects.")<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc<br>
> in _parse_hierarchy(self)<br>
>    226             return line.split()[2:]<br>
>    227         if os.path.exists(self.hierarchy_filename[:-9] + "harrays"):<br>
> --> 228             if self._parse_binary_hierarchy(): return<br>
>    229         t1 = time.time()<br>
>    230         pattern = r"Pointer:<br>
> Grid\[(\d*)\]->NextGrid(Next|This)Level = (\d*)\s+$"<br>
><br>
> /work/taskere/orca/yt-2-orca/src/yt-hg/yt/frontends/enzo/data_structures.pyc<br>
> in _parse_binary_hierarchy(self)<br>
>    300         except h5py.h5.H5Error:<br>
>    301             return False<br>
> --> 302         self.grid_dimensions[:] = f["/ActiveDimensions"][:]<br>
>    303         self.grid_left_edge[:] = f["/LeftEdges"][:]<br>
>    304         self.grid_right_edge[:] = f["/RightEdges"][:]<br>
><br>
> ValueError: shape mismatch: objects cannot be broadcast to a single shape<br>
> WARNING: Failure executing file: <image_object.py><br>
><br>
><br>
> What I don't understand is that it'll happen on one data set, but then<br>
> the next one (or the one before) in the simulation will be totally<br>
> fine. My dtdump steps are small too, so I'm confused as to why this<br>
> would occur. Both "width" and "depth" are neither very small or very<br>
> large compared to "centre". (In kpc, centre = 16, 22, 16 and width =<br>
> 4 and depth = 1.)<br>
><br>
> Elizabeth<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div>