[yt-dev] Issue #1011: Index errors when creating cut_region for particles (yt_analysis/yt)

Adam Ginsburg issues-reply at bitbucket.org
Thu Apr 2 06:51:11 PDT 2015


New issue 1011: Index errors when creating cut_region for particles
https://bitbucket.org/yt_analysis/yt/issue/1011/index-errors-when-creating-cut_region-for

Adam Ginsburg:

I have a particle data set in which each particle has an associated label (for the curious: we've identified clouds via clustering analysis in PPPVVV phase space.  Apparently this hasn't been tried before?  I still have my doubts about that, because it works...).

So, I want to create projections / renderings / contours of each cloud identified in this manner.  I tried doing this by creating a cut region:
```
cloud_region = ds.h.all_data().cut_region(["obj['cloud_id'] == {0}".format(cloud_id)])
```

but when I try projecting it, I get an index error:
```
proj = yt.ProjectionPlot(ds, direction, ('all','particle_mass'), data_source=cloud_region)
Traceback (most recent call last):
  File "<ipython-input-101-b177fa64673a>", line 1, in <module>
    proj = yt.ProjectionPlot(ds, direction, ('all','particle_mass'), data_source=cloud_region)
  File "/Users/adam/repos/yt/yt/visualization/plot_window.py", line 1391, in __init__
    field_parameters = field_parameters, method = method)
  File "/Users/adam/repos/yt/yt/data_objects/construction_data_containers.py", line 250, in __init__
    self.get_data(field)
  File "/Users/adam/repos/yt/yt/data_objects/construction_data_containers.py", line 298, in get_data
    chunk.ires.size, get_memory_usage()/1024.)
  File "/Users/adam/repos/yt/yt/data_objects/selection_data_containers.py", line 811, in ires
    return self.base_object.ires[self._cond_ind]
IndexError: index 96890 is out of bounds for axis 1 with size 96888
```

I get this independent of the cloud index I choose to compare to.  The actual number of particles is 184458 and I've confirmed that all entries in the data dictionary I pass to `yt.load_particles` have this same number.


_______________________________________________
yt-dev mailing list
yt-dev at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org




More information about the yt-dev mailing list