<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><div><div>Hi John,<br><br></div>It sounds like we have a bug in v3.0.2. But it's still not working in v3.2dev. Do you have any test data that you can use to confirm? I would just like to make sure it's not user error before I submit a bug report.<br><br></div><div>By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.<br></div><div><br></div>Cheers,<br></div>Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <span dir="ltr"><<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The reason why this would not work in previous yt versions is that annotate_particles assumed code units for length, which for flash are centimeters. So “4" would be 4 cm, a ridiculously thin slab, which would explain why you end up with a zero selection. <div><br></div><div>It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug. </div><div><div class="h5"><div><br><div><blockquote type="cite"><div>On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt<span> </span><span dir="ltr"><<a href="mailto:jason.galyardt@gmail.com" target="_blank">jason.galyardt@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all,<br><br></div>I've updated to the latest development release of yt (v3.2dev). I no longer get the ValueError to do with zero length selections when I do annotate_particles(). However, I don't get any particles in the plot either. Any other ideas?<br></div></div></div></blockquote><div><br></div><div>Can you try:<br></div><div><br></div><div>p.annotate_particles((4, 'kpc'))</div><div><br></div><div>?</div><div><br></div><div>If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/issues/new" target="_blank">https://bitbucket.org/yt_analysis/yt/issues/new</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><br></div>Thanks,<br></div>Jason<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li<span> </span><span dir="ltr"><<a href="mailto:bear0980@gmail.com" target="_blank">bear0980@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Jason,<div><br></div><div>I had trouble with Flash particles last year, and John ZuHone fixed the bug. Could you try the newest yt3 and see if the problem goes away?</div><span><font color="#888888"><div><br></div><div>Yuan</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt<span> </span><span dir="ltr"><<a href="mailto:jason.galyardt@gmail.com" target="_blank">jason.galyardt@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Nathan,<br><br></div>I'm using yt version 3.0.2 (which I see is not quite current) on Debian 7 (wheezy). I tried to pastebin the iPython error traceback, but it failed with a complaint that the MySQL server has 'gone away'. With apologies to the list, here's the traceback:<br><br>---------------------------------------------------------------------------<br>ValueError                                Traceback (most recent call last)<br><ipython-input-49-3f118016da60> in <module>()<br>----> 1 p.annotate_particles((4.0,'kpc'))<br><br>/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs)<br>    <span> </span>68         rv = f(*args, **kwargs)<br>    <span> </span>69         args[0]._plot_valid = False<br>---> 70         args[0]._setup_plots()<br>    <span> </span>71         return rv<br>    <span> </span>72     return newfunc<br><br>/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self)<br>   <span> </span>860                 label.set_fontproperties(fp)<br>   <span> </span>861<span> </span><br>--> 862             self.run_callbacks(f)<br>   <span> </span>863<span> </span><br>   <span> </span>864             if draw_axes is False:<br><br>/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f)<br>   <span> </span>313             CallbackMaker = callback_registry[name]<br>   <span> </span>314             callback = CallbackMaker(*args[1:], **kwargs)<br>--> 315             callback(cbw)<br>   <span> </span>316         for key in self.frb.keys():<br>   <span> </span>317             if key not in keys:<br><br>/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot)<br>  <span> </span>1053         pt = self.ptype<br>  <span> </span>1054         gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 )<br>-> 1055            &   ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) )<br>  <span> </span>1056         if self.minimum_mass is not None:<br>  <span> </span>1057             gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)<br><br>/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key)<br>   <span> </span>238                 return self.field_data[f]<br>   <span> </span>239             else:<br>--> 240                 self.get_data(f)<br>   <span> </span>241         # fi.units is the unit expression string. We depend on the registry<br>   <span> </span>242         # hanging off the dataset to define this unit object.<br><br>/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields)<br>   <span> </span>665<span> </span><br>   <span> </span>666         read_particles, gen_particles = self.index._read_particle_fields(<br>--> 667                                         particles, self, self._current_chunk)<br>   <span> </span>668         for f, v in read_particles.items():<br>   <span> </span>669             self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)<br><br>/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk)<br>   <span> </span>232             self._chunk_io(dobj, cache = False),<br>   <span> </span>233             selector,<br>--> 234             fields_to_read)<br>   <span> </span>235         return fields_to_return, fields_to_generate<br>   <span> </span>236<span> </span><br><br>/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields)<br>   <span> </span>148         # Here, ptype_map means which particles contribute to a given type.<br>   <span> </span>149         # And ptf is the actual fields from disk to read.<br>--> 150         psize = self._count_particles_chunks(chunks, ptf, selector)<br>   <span> </span>151         # Now we allocate<br>   <span> </span>152         # ptf, remember, is our mapping of what we want to read<br><br>/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector)<br>   <span> </span>119     def _count_particles_chunks(self, chunks, ptf, selector):<br>   <span> </span>120         psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK<br>--> 121         for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf):<br>   <span> </span>122             psize[ptype] += selector.count_points(x, y, z, 0.0)<br>   <span> </span>123         return dict(psize.items())<br><br>/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf)<br>    <span> </span>72                 start = p_ind[<a href="http://g1.id/" target="_blank">g1.id</a><span> </span>- g1._id_offset]<br>    <span> </span>73                 end = p_ind[<a href="http://g2.id/" target="_blank">g2.id</a><span> </span>- g2._id_offset + 1]<br>---> 74                 x = np.asarray(p_fields[start:end, px], dtype="=f8")<br>    <span> </span>75                 y = np.asarray(p_fields[start:end, py], dtype="=f8")<br>    <span> </span>76                 z = np.asarray(p_fields[start:end, pz], dtype="=f8")<br><br>/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args)<br>   <span> </span>312<span> </span><br>   <span> </span>313         # Perform the dataspace selection.<br>--> 314         selection = sel.select(self.shape, args, dsid=<a href="http://self.id/" target="_blank">self.id</a>)<br>   <span> </span>315<span> </span><br>   <span> </span>316         if selection.nselect == 0:<br><br>/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid)<br>    <span> </span>92<span> </span><br>    <span> </span>93     sel = SimpleSelection(shape)<br>---> 94     sel[args]<br>    <span> </span>95     return sel<br>    <span> </span>96<span> </span><br><br>/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args)<br>   <span> </span>259             return self<br>   <span> </span>260<span> </span><br>--> 261         start, count, step, scalar = _handle_simple(self.shape,args)<br>   <span> </span>262<span> </span><br>   <span> </span>263         self._id.select_hyperslab(start, count, step)<br><br>/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args)<br>   <span> </span>510     for arg, length in zip(args, shape):<br>   <span> </span>511         if isinstance(arg, slice):<br>--> 512             x,y,z = _translate_slice(arg, length)<br>   <span> </span>513             s = False<br>   <span> </span>514         else:<br><br>/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length)<br>   <span> </span>551         raise ValueError("Step must be >= 1 (got %d)" % step)<br>   <span> </span>552     if stop == start:<br>--> 553         raise ValueError("Zero-length selections are not allowed")<br>   <span> </span>554     if stop < start:<br>   <span> </span>555         raise ValueError("Reverse-order selections are not allowed")<br><br>ValueError: Zero-length selections are not allowed<br>------------------------------------------------------------------------<br><br></div><div>Let me know if any other info would be useful.<br></div><div><br></div>Cheers,<br></div>Jason<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum<span> </span><span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum<span> </span><span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt<span> </span><span dir="ltr"><<a href="mailto:jason.galyardt@gmail.com" target="_blank">jason.galyardt@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>I'm sure I've just overlooked some bit of documentation, but I'm having trouble plotting particles generated by FLASH on top of the gas density. I've been able to load a plot file with the associated particle file via<span> </span><br><br>ds = yt.load(plotfileName, particle_filename=partfileName)<br><br><br></div>However, when I try to create a projection and annotate the particles with<br><br></div>p = yt.ProjectionPlot(ds, "y", "density")<br>p.annotate_particles(1.0)                      # ValueError!<br></div><div># p.annotate_particles((4.0, 'kpc'))         # ValueError!<br></div><div><br></div></div></div></div></blockquote><div><br></div></span><div>Can you pastebin the full error traceback?  Which yt version are you using?</div></div></div></div></blockquote><div><br></div></span><div>Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><div dir="ltr"><div><div><div>I get a ValueError from h5py indicating that zero-length selections are not allowed. I have also tried passing the full width of the simulation domain to the annotation function without success. I suspect that this is a user error stemming from differences between the way that Enzo and FLASH store particle data. However, I can't find much in the way of documentation or examples for the FLASH particle data format.<span> </span><br><br>Of course, it would also be handy to be able to write my own analysis scripts using both gas and particles, but for now, I'll settle for any help I can get on simple plotting functionality.<br><br></div>Thanks,<br><br></div>Jason Galyardt<br></div>Department of Physics and Astronomy<br><div><div><div>University of Georgia<br></div><div><br></div></div></div></div><br></span>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br></blockquote></div><br></div></div></blockquote></span></div><br></div></div><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br></blockquote></div><br></div></div></div><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br></blockquote></div><br></div></div></div><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br></blockquote></div><br></div></div></div><br>_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org" target="_blank">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><br></blockquote></div><br></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">yt-users mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:yt-users@lists.spacepope.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">yt-users@lists.spacepope.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></blockquote></div><br></div></div></div></div><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>
<br></blockquote></div><br></div>