Particles in FLASH output
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Hi all, 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 ds = yt.load(plotfileName, particle_filename=partfileName) However, when I try to create a projection and annotate the particles with p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError! 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. 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. Thanks, Jason Galyardt Department of Physics and Astronomy University of Georgia _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com
wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Nathan, 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: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc')) /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False: /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys: /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass) /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object. /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) /usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236 /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items()) /usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8") /usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0: /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96 /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step) /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else: /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed") ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------ Let me know if any other info would be useful. Cheers, Jason On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/0e0072c3ef813b4e277344e182b80fae.jpg?s=120&d=mm&r=g)
Hi Jason, 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? Yuan On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
There are instructions to switch to the development version here: http://yt-project.org/docs/dev/installing.html#installing-yt-using-pip-or-fr... On Tue, Apr 28, 2015 at 11:56 AM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com
wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Hi all, 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? Thanks, Jason On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com
wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Hi all,
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?
Can you try: p.annotate_particles((4, 'kpc')) ? If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly? https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com
wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum < nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/519d491fa9fe7dfd0caf0f0a9c2ca61e.jpg?s=120&d=mm&r=g)
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. It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new <https://bitbucket.org/yt_analysis/yt/issues/new>
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com <mailto:bear0980@gmail.com>> wrote: Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id <http://g1.id/> - g1._id_offset] 73 end = p_ind[g2.id <http://g2.id/> - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id <http://self.id/>) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Hi John, 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. By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt. Cheers, Jason On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com> wrote:
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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com
wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com
wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum < nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
> Hi all, > > 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 > > ds = yt.load(plotfileName, particle_filename=partfileName) > > > However, when I try to create a projection and annotate the > particles with > > p = yt.ProjectionPlot(ds, "y", "density") > p.annotate_particles(1.0) # ValueError! > # p.annotate_particles((4.0, 'kpc')) # ValueError! > > Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
> 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. > > 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. > > Thanks, > > Jason Galyardt > Department of Physics and Astronomy > University of Georgia > > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > >
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
We have several public FLASH test datasets here: http://yt-project.org/data/ I'm not sure whether any of them have both gas and particles. If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past. On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com> wrote:
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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed
------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum < nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum < nathan12343@gmail.com> wrote:
> > > On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < > jason.galyardt@gmail.com> wrote: > >> Hi all, >> >> 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 >> >> ds = yt.load(plotfileName, particle_filename=partfileName) >> >> >> However, when I try to create a projection and annotate the >> particles with >> >> p = yt.ProjectionPlot(ds, "y", "density") >> p.annotate_particles(1.0) # ValueError! >> # p.annotate_particles((4.0, 'kpc')) # ValueError! >> >> > Can you pastebin the full error traceback? Which yt version are you > using? >
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
> > >> 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. >> >> 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. >> >> Thanks, >> >> Jason Galyardt >> Department of Physics and Astronomy >> University of Georgia >> >> >> _______________________________________________ >> yt-users mailing list >> yt-users@lists.spacepope.org >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >> >> >
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/519d491fa9fe7dfd0caf0f0a9c2ca61e.jpg?s=120&d=mm&r=g)
When I come back from the colloquium I will see what I can do with one of my own datasets. Jason, what is your domain size, and the size of the smallest cell? John ZuHone Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Apr 28, 2015, at 3:55 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
We have several public FLASH test datasets here:
I'm not sure whether any of them have both gas and particles.
If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past.
On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote: Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com> wrote: 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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote: Hi Jason,
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?
Yuan
> On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote: > Nathan, > > 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: > > --------------------------------------------------------------------------- > ValueError Traceback (most recent call last) > <ipython-input-49-3f118016da60> in <module>() > ----> 1 p.annotate_particles((4.0,'kpc')) > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) > 68 rv = f(*args, **kwargs) > 69 args[0]._plot_valid = False > ---> 70 args[0]._setup_plots() > 71 return rv > 72 return newfunc > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) > 860 label.set_fontproperties(fp) > 861 > --> 862 self.run_callbacks(f) > 863 > 864 if draw_axes is False: > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) > 313 CallbackMaker = callback_registry[name] > 314 callback = CallbackMaker(*args[1:], **kwargs) > --> 315 callback(cbw) > 316 for key in self.frb.keys(): > 317 if key not in keys: > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) > 1053 pt = self.ptype > 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) > -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) > 1056 if self.minimum_mass is not None: > 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass) > > /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) > 238 return self.field_data[f] > 239 else: > --> 240 self.get_data(f) > 241 # fi.units is the unit expression string. We depend on the registry > 242 # hanging off the dataset to define this unit object. > > /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) > 665 > 666 read_particles, gen_particles = self.index._read_particle_fields( > --> 667 particles, self, self._current_chunk) > 668 for f, v in read_particles.items(): > 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units) > > /usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) > 232 self._chunk_io(dobj, cache = False), > 233 selector, > --> 234 fields_to_read) > 235 return fields_to_return, fields_to_generate > 236 > > /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) > 148 # Here, ptype_map means which particles contribute to a given type. > 149 # And ptf is the actual fields from disk to read. > --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) > 151 # Now we allocate > 152 # ptf, remember, is our mapping of what we want to read > > /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) > 119 def _count_particles_chunks(self, chunks, ptf, selector): > 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK > --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): > 122 psize[ptype] += selector.count_points(x, y, z, 0.0) > 123 return dict(psize.items()) > > /usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) > 72 start = p_ind[g1.id - g1._id_offset] > 73 end = p_ind[g2.id - g2._id_offset + 1] > ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") > 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") > 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8") > > /usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) > 312 > 313 # Perform the dataspace selection. > --> 314 selection = sel.select(self.shape, args, dsid=self.id) > 315 > 316 if selection.nselect == 0: > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) > 92 > 93 sel = SimpleSelection(shape) > ---> 94 sel[args] > 95 return sel > 96 > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) > 259 return self > 260 > --> 261 start, count, step, scalar = _handle_simple(self.shape,args) > 262 > 263 self._id.select_hyperslab(start, count, step) > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) > 510 for arg, length in zip(args, shape): > 511 if isinstance(arg, slice): > --> 512 x,y,z = _translate_slice(arg, length) > 513 s = False > 514 else: > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) > 551 raise ValueError("Step must be >= 1 (got %d)" % step) > 552 if stop == start: > --> 553 raise ValueError("Zero-length selections are not allowed") > 554 if stop < start: > 555 raise ValueError("Reverse-order selections are not allowed") > > ValueError: Zero-length selections are not allowed > ------------------------------------------------------------------------ > > Let me know if any other info would be useful. > > Cheers, > Jason > >> On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote: >> >> >>> On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com> wrote: >>> >>> >>>> On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com> wrote: >>>> Hi all, >>>> >>>> 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 >>>> >>>> ds = yt.load(plotfileName, particle_filename=partfileName) >>>> >>>> >>>> However, when I try to create a projection and annotate the particles with >>>> >>>> p = yt.ProjectionPlot(ds, "y", "density") >>>> p.annotate_particles(1.0) # ValueError! >>>> # p.annotate_particles((4.0, 'kpc')) # ValueError! >>> >>> Can you pastebin the full error traceback? Which yt version are you using? >> >> Forgot to mention that you can get precise version information by executing "yt version" at the bash command line. >> >>> >>>> 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. >>>> >>>> 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. >>>> >>>> Thanks, >>>> >>>> Jason Galyardt >>>> Department of Physics and Astronomy >>>> University of Georgia >>>> >>>> >>>> _______________________________________________ >>>> yt-users mailing list >>>> yt-users@lists.spacepope.org >>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >> >> >> _______________________________________________ >> yt-users mailing list >> yt-users@lists.spacepope.org >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Thanks, John. My domain size is 4 x 4 x 24 kpc, and the size of the smallest cell is 31.25 pc, according to print_stats(). Here's the grid info, in case it's useful: level # grids # cells # cells^3 ---------------------------------------------- 0 48 24576 30 1 384 196608 59 2 3072 1572864 117 3 24448 12517376 233 ---------------------------------------------- 27952 14311424 Cheers, Jason On Tue, Apr 28, 2015 at 4:00 PM, John ZuHone <jzuhone@gmail.com> wrote:
When I come back from the colloquium I will see what I can do with one of my own datasets.
Jason, what is your domain size, and the size of the smallest cell?
John ZuHone Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Apr 28, 2015, at 3:55 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
We have several public FLASH test datasets here:
I'm not sure whether any of them have both gas and particles.
If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past.
On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt <jason.galyardt@gmail.com
wrote:
Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com> wrote:
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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id - g1._id_offset] 73 end = p_ind[g2.id - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id ) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed
------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum < nathan12343@gmail.com> wrote:
> > > On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum < > nathan12343@gmail.com> wrote: > >> >> >> On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < >> jason.galyardt@gmail.com> wrote: >> >>> Hi all, >>> >>> 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 >>> >>> ds = yt.load(plotfileName, particle_filename=partfileName) >>> >>> >>> However, when I try to create a projection and annotate the >>> particles with >>> >>> p = yt.ProjectionPlot(ds, "y", "density") >>> p.annotate_particles(1.0) # ValueError! >>> # p.annotate_particles((4.0, 'kpc')) # ValueError! >>> >>> >> Can you pastebin the full error traceback? Which yt version are >> you using? >> > > Forgot to mention that you can get precise version information by > executing "yt version" at the bash command line. > > >> >> >>> 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. >>> >>> 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. >>> >>> Thanks, >>> >>> Jason Galyardt >>> Department of Physics and Astronomy >>> University of Georgia >>> >>> >>> _______________________________________________ >>> yt-users mailing list >>> yt-users@lists.spacepope.org >>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >>> >>> >> > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > >
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/519d491fa9fe7dfd0caf0f0a9c2ca61e.jpg?s=120&d=mm&r=g)
Jason, What is your traceback now? I’m also getting a failure over here but I want to check it against yours. Best, John
On Apr 28, 2015, at 4:08 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Thanks, John. My domain size is 4 x 4 x 24 kpc, and the size of the smallest cell is 31.25 pc, according to print_stats(). Here's the grid info, in case it's useful:
level # grids # cells # cells^3 ---------------------------------------------- 0 48 24576 30 1 384 196608 59 2 3072 1572864 117 3 24448 12517376 233 ---------------------------------------------- 27952 14311424
Cheers, Jason
On Tue, Apr 28, 2015 at 4:00 PM, John ZuHone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: When I come back from the colloquium I will see what I can do with one of my own datasets.
Jason, what is your domain size, and the size of the smallest cell?
John ZuHone Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave. <>, 37-582G Cambridge, MA 02139 <> (w) 617-253-2354 <tel:617-253-2354> (m) 781-708-5004 <tel:781-708-5004> jzuhone@space.mit.edu <mailto:jzuhone@space.mit.edu> jzuhone@gmail.com <mailto:jzuhone@gmail.com> http://www.jzuhone.com <http://www.jzuhone.com/>
On Apr 28, 2015, at 3:55 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
We have several public FLASH test datasets here:
http://yt-project.org/data/ <http://yt-project.org/data/>
I'm not sure whether any of them have both gas and particles.
If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past.
On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: 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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new <https://bitbucket.org/yt_analysis/yt/issues/new>
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com <mailto:bear0980@gmail.com>> wrote: Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id <http://g1.id/> - g1._id_offset] 73 end = p_ind[g2.id <http://g2.id/> - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id <http://self.id/>) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Hi John, There is no traceback; it fails silently. Jason On Apr 28, 2015 5:37 PM, "John Zuhone" <jzuhone@gmail.com> wrote:
Jason,
What is your traceback now? I’m also getting a failure over here but I want to check it against yours.
Best,
John
On Apr 28, 2015, at 4:08 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Thanks, John. My domain size is 4 x 4 x 24 kpc, and the size of the smallest cell is 31.25 pc, according to print_stats(). Here's the grid info, in case it's useful:
level # grids # cells # cells^3 ---------------------------------------------- 0 48 24576 30 1 384 196608 59 2 3072 1572864 117 3 24448 12517376 233 ---------------------------------------------- 27952 14311424
Cheers, Jason
On Tue, Apr 28, 2015 at 4:00 PM, John ZuHone <jzuhone@gmail.com> wrote:
When I come back from the colloquium I will see what I can do with one of my own datasets.
Jason, what is your domain size, and the size of the smallest cell?
John ZuHone Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Apr 28, 2015, at 3:55 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
We have several public FLASH test datasets here:
I'm not sure whether any of them have both gas and particles.
If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past.
On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com> wrote:
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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com> wrote:
Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt < jason.galyardt@gmail.com> wrote:
> Nathan, > > 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: > > > --------------------------------------------------------------------------- > ValueError Traceback (most recent > call last) > <ipython-input-49-3f118016da60> in <module>() > ----> 1 p.annotate_particles((4.0,'kpc')) > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc > in newfunc(*args, **kwargs) > 68 rv = f(*args, **kwargs) > 69 args[0]._plot_valid = False > ---> 70 args[0]._setup_plots() > 71 return rv > 72 return newfunc > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc > in _setup_plots(self) > 860 label.set_fontproperties(fp) > 861 > --> 862 self.run_callbacks(f) > 863 > 864 if draw_axes is False: > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc > in run_callbacks(self, f) > 313 CallbackMaker = callback_registry[name] > 314 callback = CallbackMaker(*args[1:], **kwargs) > --> 315 callback(cbw) > 316 for key in self.frb.keys(): > 317 if key not in keys: > > /usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc > in __call__(self, plot) > 1053 pt = self.ptype > 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, > field_x] <= x1 ) > -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, > field_y] <= y1 ) ) > 1056 if self.minimum_mass is not None: > 1057 gg &= (reg[pt, "particle_mass"] >= > self.minimum_mass) > > /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc > in __getitem__(self, key) > 238 return self.field_data[f] > 239 else: > --> 240 self.get_data(f) > 241 # fi.units is the unit expression string. We depend > on the registry > 242 # hanging off the dataset to define this unit > object. > > /usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc > in get_data(self, fields) > 665 > 666 read_particles, gen_particles = > self.index._read_particle_fields( > --> 667 particles, self, > self._current_chunk) > 668 for f, v in read_particles.items(): > 669 self.field_data[f] = self.ds.arr(v, input_units > = finfos[f].units) > > /usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc > in _read_particle_fields(self, fields, dobj, chunk) > 232 self._chunk_io(dobj, cache = False), > 233 selector, > --> 234 fields_to_read) > 235 return fields_to_return, fields_to_generate > 236 > > /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc > in _read_particle_selection(self, chunks, selector, fields) > 148 # Here, ptype_map means which particles contribute > to a given type. > 149 # And ptf is the actual fields from disk to read. > --> 150 psize = self._count_particles_chunks(chunks, ptf, > selector) > 151 # Now we allocate > 152 # ptf, remember, is our mapping of what we want to > read > > /usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc > in _count_particles_chunks(self, chunks, ptf, selector) > 119 def _count_particles_chunks(self, chunks, ptf, > selector): > 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON > DISK > --> 121 for ptype, (x, y, z) in > self._read_particle_coords(chunks, ptf): > 122 psize[ptype] += selector.count_points(x, y, z, > 0.0) > 123 return dict(psize.items()) > > /usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in > _read_particle_coords(self, chunks, ptf) > 72 start = p_ind[g1.id - g1._id_offset] > 73 end = p_ind[g2.id - g2._id_offset + 1] > ---> 74 x = np.asarray(p_fields[start:end, px], > dtype="=f8") > 75 y = np.asarray(p_fields[start:end, py], > dtype="=f8") > 76 z = np.asarray(p_fields[start:end, pz], > dtype="=f8") > > /usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in > __getitem__(self, args) > 312 > 313 # Perform the dataspace selection. > --> 314 selection = sel.select(self.shape, args, dsid= > self.id) > 315 > 316 if selection.nselect == 0: > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in > select(shape, args, dsid) > 92 > 93 sel = SimpleSelection(shape) > ---> 94 sel[args] > 95 return sel > 96 > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in > __getitem__(self, args) > 259 return self > 260 > --> 261 start, count, step, scalar = > _handle_simple(self.shape,args) > 262 > 263 self._id.select_hyperslab(start, count, step) > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in > _handle_simple(shape, args) > 510 for arg, length in zip(args, shape): > 511 if isinstance(arg, slice): > --> 512 x,y,z = _translate_slice(arg, length) > 513 s = False > 514 else: > > /usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in > _translate_slice(exp, length) > 551 raise ValueError("Step must be >= 1 (got %d)" % > step) > 552 if stop == start: > --> 553 raise ValueError("Zero-length selections are not > allowed") > 554 if stop < start: > 555 raise ValueError("Reverse-order selections are not > allowed") > > ValueError: Zero-length selections are not allowed > > ------------------------------------------------------------------------ > > Let me know if any other info would be useful. > > Cheers, > Jason > > On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum < > nathan12343@gmail.com> wrote: > >> >> >> On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum < >> nathan12343@gmail.com> wrote: >> >>> >>> >>> On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt < >>> jason.galyardt@gmail.com> wrote: >>> >>>> Hi all, >>>> >>>> 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 >>>> >>>> ds = yt.load(plotfileName, particle_filename=partfileName) >>>> >>>> >>>> However, when I try to create a projection and annotate the >>>> particles with >>>> >>>> p = yt.ProjectionPlot(ds, "y", "density") >>>> p.annotate_particles(1.0) # ValueError! >>>> # p.annotate_particles((4.0, 'kpc')) # ValueError! >>>> >>>> >>> Can you pastebin the full error traceback? Which yt version are >>> you using? >>> >> >> Forgot to mention that you can get precise version information by >> executing "yt version" at the bash command line. >> >> >>> >>> >>>> 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. >>>> >>>> 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. >>>> >>>> Thanks, >>>> >>>> Jason Galyardt >>>> Department of Physics and Astronomy >>>> University of Georgia >>>> >>>> >>>> _______________________________________________ >>>> yt-users mailing list >>>> yt-users@lists.spacepope.org >>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >>>> >>>> >>> >> >> _______________________________________________ >> yt-users mailing list >> yt-users@lists.spacepope.org >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >> >> > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > >
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/519d491fa9fe7dfd0caf0f0a9c2ca61e.jpg?s=120&d=mm&r=g)
Hmm, odd. At this point the best suggestion is Nathan’s—if you are able to post your dataset somewhere for us to look at, that would be helpful. You can shoot me private mail at jzuhone@gmail.com if you don’t want it to go out to the whole list. Best, John
On Apr 28, 2015, at 6:28 PM, Jason Galyardt <jason.galyardt@gmail.com> wrote:
Hi John,
There is no traceback; it fails silently.
Jason
On Apr 28, 2015 5:37 PM, "John Zuhone" <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: Jason,
What is your traceback now? I’m also getting a failure over here but I want to check it against yours.
Best,
John
On Apr 28, 2015, at 4:08 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote:
Thanks, John. My domain size is 4 x 4 x 24 kpc, and the size of the smallest cell is 31.25 pc, according to print_stats(). Here's the grid info, in case it's useful:
level # grids # cells # cells^3 ---------------------------------------------- 0 48 24576 30 1 384 196608 59 2 3072 1572864 117 3 24448 12517376 233 ---------------------------------------------- 27952 14311424
Cheers, Jason
On Tue, Apr 28, 2015 at 4:00 PM, John ZuHone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: When I come back from the colloquium I will see what I can do with one of my own datasets.
Jason, what is your domain size, and the size of the smallest cell?
John ZuHone Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave. <>, 37-582G Cambridge, MA 02139 <> (w) 617-253-2354 <tel:617-253-2354> (m) 781-708-5004 <tel:781-708-5004> jzuhone@space.mit.edu <mailto:jzuhone@space.mit.edu> jzuhone@gmail.com <mailto:jzuhone@gmail.com> http://www.jzuhone.com <http://www.jzuhone.com/>
On Apr 28, 2015, at 3:55 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
We have several public FLASH test datasets here:
http://yt-project.org/data/ <http://yt-project.org/data/>
I'm not sure whether any of them have both gas and particles.
If you're ok with it and your dataset isn't enormous, it might help to share one of the data files you're working with. We've used dropbox or google drive to share big files on the mailing list in the past.
On Tue, Apr 28, 2015 at 12:52 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi John,
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.
By the way, my output files seem fine - I can plot both gas density and particle locations simultaneously in VisIt.
Cheers, Jason
On Tue, Apr 28, 2015 at 3:44 PM, John Zuhone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: 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.
It should work now, based on looking at the code, so if it doesn’t then we definitely have a bug.
On Apr 28, 2015, at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
https://bitbucket.org/yt_analysis/yt/issues/new <https://bitbucket.org/yt_analysis/yt/issues/new>
Thanks, Jason
On Tue, Apr 28, 2015 at 2:56 PM, Yuan Li <bear0980@gmail.com <mailto:bear0980@gmail.com>> wrote: Hi Jason,
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?
Yuan
On Tue, Apr 28, 2015 at 2:53 PM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Nathan,
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:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-49-3f118016da60> in <module>() ----> 1 p.annotate_particles((4.0,'kpc'))
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs) 68 rv = f(*args, **kwargs) 69 args[0]._plot_valid = False ---> 70 args[0]._setup_plots() 71 return rv 72 return newfunc
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_window.pyc in _setup_plots(self) 860 label.set_fontproperties(fp) 861 --> 862 self.run_callbacks(f) 863 864 if draw_axes is False:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_container.pyc in run_callbacks(self, f) 313 CallbackMaker = callback_registry[name] 314 callback = CallbackMaker(*args[1:], **kwargs) --> 315 callback(cbw) 316 for key in self.frb.keys(): 317 if key not in keys:
/usr/local/lib/python2.7/dist-packages/yt/visualization/plot_modifications.pyc in __call__(self, plot) 1053 pt = self.ptype 1054 gg = ( ( reg[pt, field_x] >= x0 ) & ( reg[pt, field_x] <= x1 ) -> 1055 & ( reg[pt, field_y] >= y0 ) & ( reg[pt, field_y] <= y1 ) ) 1056 if self.minimum_mass is not None: 1057 gg &= (reg[pt, "particle_mass"] >= self.minimum_mass)
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in __getitem__(self, key) 238 return self.field_data[f] 239 else: --> 240 self.get_data(f) 241 # fi.units is the unit expression string. We depend on the registry 242 # hanging off the dataset to define this unit object.
/usr/local/lib/python2.7/dist-packages/yt/data_objects/data_containers.pyc in get_data(self, fields) 665 666 read_particles, gen_particles = self.index._read_particle_fields( --> 667 particles, self, self._current_chunk) 668 for f, v in read_particles.items(): 669 self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)
/usr/local/lib/python2.7/dist-packages/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk) 232 self._chunk_io(dobj, cache = False), 233 selector, --> 234 fields_to_read) 235 return fields_to_return, fields_to_generate 236
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields) 148 # Here, ptype_map means which particles contribute to a given type. 149 # And ptf is the actual fields from disk to read. --> 150 psize = self._count_particles_chunks(chunks, ptf, selector) 151 # Now we allocate 152 # ptf, remember, is our mapping of what we want to read
/usr/local/lib/python2.7/dist-packages/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector) 119 def _count_particles_chunks(self, chunks, ptf, selector): 120 psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK --> 121 for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf): 122 psize[ptype] += selector.count_points(x, y, z, 0.0) 123 return dict(psize.items())
/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/io.pyc in _read_particle_coords(self, chunks, ptf) 72 start = p_ind[g1.id <http://g1.id/> - g1._id_offset] 73 end = p_ind[g2.id <http://g2.id/> - g2._id_offset + 1] ---> 74 x = np.asarray(p_fields[start:end, px], dtype="=f8") 75 y = np.asarray(p_fields[start:end, py], dtype="=f8") 76 z = np.asarray(p_fields[start:end, pz], dtype="=f8")
/usr/lib/python2.7/dist-packages/h5py/_hl/dataset.pyc in __getitem__(self, args) 312 313 # Perform the dataspace selection. --> 314 selection = sel.select(self.shape, args, dsid=self.id <http://self.id/>) 315 316 if selection.nselect == 0:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in select(shape, args, dsid) 92 93 sel = SimpleSelection(shape) ---> 94 sel[args] 95 return sel 96
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in __getitem__(self, args) 259 return self 260 --> 261 start, count, step, scalar = _handle_simple(self.shape,args) 262 263 self._id.select_hyperslab(start, count, step)
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _handle_simple(shape, args) 510 for arg, length in zip(args, shape): 511 if isinstance(arg, slice): --> 512 x,y,z = _translate_slice(arg, length) 513 s = False 514 else:
/usr/lib/python2.7/dist-packages/h5py/_hl/selections.pyc in _translate_slice(exp, length) 551 raise ValueError("Step must be >= 1 (got %d)" % step) 552 if stop == start: --> 553 raise ValueError("Zero-length selections are not allowed") 554 if stop < start: 555 raise ValueError("Reverse-order selections are not allowed")
ValueError: Zero-length selections are not allowed ------------------------------------------------------------------------
Let me know if any other info would be useful.
Cheers, Jason
On Tue, Apr 28, 2015 at 2:39 PM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343@gmail.com <mailto:nathan12343@gmail.com>> wrote:
On Tue, Apr 28, 2015 at 11:36 AM, Jason Galyardt <jason.galyardt@gmail.com <mailto:jason.galyardt@gmail.com>> wrote: Hi all,
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
ds = yt.load(plotfileName, particle_filename=partfileName)
However, when I try to create a projection and annotate the particles with
p = yt.ProjectionPlot(ds, "y", "density") p.annotate_particles(1.0) # ValueError! # p.annotate_particles((4.0, 'kpc')) # ValueError!
Can you pastebin the full error traceback? Which yt version are you using?
Forgot to mention that you can get precise version information by executing "yt version" at the bash command line.
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.
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.
Thanks,
Jason Galyardt Department of Physics and Astronomy University of Georgia
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
![](https://secure.gravatar.com/avatar/d60e90f3a0312c7e9994a16e423b145b.jpg?s=120&d=mm&r=g)
Hi Nathan, On Tue, Apr 28, 2015 at 3:37 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Apr 28, 2015 at 12:27 PM, Jason Galyardt <jason.galyardt@gmail.com
wrote:
Hi all,
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?
Can you try:
p.annotate_particles((4, 'kpc'))
No joy. I even restarted iPython before trying this. Jason
?
If that works, can you file a bug about annotate_particles not handling widths that are YTQuantity instances correctly?
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (5)
-
Jason Galyardt
-
John Zuhone
-
John ZuHone
-
Nathan Goldbaum
-
Yuan Li