<div dir="ltr">Hi Jonathan,<div><br></div><div>I just tried this using WDMerger_hdf5_chk_1000 (see <a href="http://yt-project.org/data">yt-project.org/data</a>), which is a FLASH dataset from a simulation done in cylindrical coordinates, but it seems to work for me ok using that dataset:</div><div><br></div><div><div>    $ yt load WDMerger_hdf5_chk_1000/WDMerger_hdf5_chk_1000.hdf5</div><div><br></div><div>    In [1]: slc = ds.slice(2, 0.)</div><div><br></div><div>    In [2]: slc['dr'].min()</div><div>    Out[2]: 25600000.0 code_length</div></div><div><br></div><div>Somehow something is getting set to a NaN, my guess is <span style="font-size:12.8px">gobj.LeftEdge[i]. In this context gobj is a grid object, so for some reason grid.LeftEdge is NaN along one of your axes for at least one of your grids. You can navigate the grid hierarchy by looking at the grid array: ds.index.grids[0] should be a reference to the root grid. You can also just iterate over ds.index.grids to look at all the grids in your dataset.</span></div><div><br></div><div>Is there any chance you can share the dataset that's causing this issue? We have the yt curldrop (<a href="https://docs.hub.yt/services.html#curldrop">https://docs.hub.yt/services.html#curldrop</a>) available for sharing data publicly. If it's not ok to share the dataset publicly we can try sharing it off-list.</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 11:43 AM, Slavin, Jonathan <span dir="ltr"><<a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi all,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">After upgrading yt to 3.3.3 I'm having trouble with slices.  Specifically I'm doing:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">ds = yt.load(file)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">slc = ds.slice(2,0.)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">dx = slc['dr'].min()</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">This is for FLASH data from a run in cylindrical (r,z) symmetry.  What I get is:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div><div>ValueError                                Traceback (most recent call last)</div><div>/export/slavin/FLASH/mmsnr/<wbr>plot_image.py in <module>()</div><div>    101     slc = ds.slice(2,0.)</div><div>    102     if first:</div><div>--> 103         dx = slc['dr'].min()</div><div>    104         xgl = ds.index.grids[0].LeftEdge[0]</div><div>    105         xgr = ds.index.grids[-1].RightEdge[<wbr>0]</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/data_objects/data_<wbr>containers.pyc in __getitem__(self, key)</div><div>    270                 return self.field_data[f]</div><div>    271             else:</div><div>--> 272                 self.get_data(f)</div><div>    273         # fi.units is the unit expression string. We depend on the registry</div><div>    274         # hanging off the dataset to define this unit object.</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/data_objects/data_<wbr>containers.pyc in get_data(self, fields)</div><div>   1119     def get_data(self, fields=None):</div><div>   1120         if self._current_chunk is None:</div><div>-> 1121             self.index._identify_base_<wbr>chunk(self)</div><div>   1122         if fields is None: return</div><div>   1123         nfields = []</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/geometry/grid_<wbr>geometry_handler.pyc in _identify_base_chunk(self, dobj)</div><div>    302         #    fast_index = self._get_grid_tree()</div><div>    303         if getattr(dobj, "size", None) is None:</div><div>--> 304             dobj.size = self._count_selection(dobj, fast_index = fast_index)</div><div>    305         if getattr(dobj, "shape", None) is None:</div><div>    306             dobj.shape = (dobj.size,)</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/geometry/grid_<wbr>geometry_handler.pyc in _count_selection(self, dobj, grids, fast_index)</div><div>    312             return fast_index.count(dobj.<wbr>selector)</div><div>    313         if grids is None: grids = dobj._chunk_info</div><div>--> 314         count = sum((g.count(dobj.selector) for g in grids))</div><div>    315         return count</div><div>    316 </div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/geometry/grid_<wbr>geometry_handler.pyc in <genexpr>((g,))</div><div>    312             return fast_index.count(dobj.<wbr>selector)</div><div>    313         if grids is None: grids = dobj._chunk_info</div><div>--> 314         count = sum((g.count(dobj.selector) for g in grids))</div><div>    315         return count</div><div>    316 </div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/data_objects/grid_<wbr>patch.pyc in count(self, selector)</div><div>    381 </div><div>    382     def count(self, selector):</div><div>--> 383         mask = self._get_selector_mask(<wbr>selector)</div><div>    384         if mask is None: return 0</div><div>    385         return self._last_count</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/data_objects/grid_<wbr>patch.pyc in _get_selector_mask(self, selector)</div><div>    363             mask = self._last_mask</div><div>    364         else:</div><div>--> 365             mask = selector.fill_mask(self)</div><div>    366             if self._cache_mask:</div><div>    367                 self._last_mask = mask</div><div><br></div><div>/export/slavin/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/yt/geometry/<wbr>selection_routines.pyx in yt.geometry.selection_<wbr>routines.SliceSelector.fill_<wbr>mask (yt/geometry/selection_<wbr>routines.c:21029)()</div><div>   1235                 if i == self.axis:</div><div>   1236                     ind[i][0] = \</div><div>-> 1237                         <int> ((self.coord - (gobj.LeftEdge[i]).to_ndarray(<wbr>)) /</div><div>   1238                                gobj.dds[i])</div><div>   1239                     ind[i][1] = ind[i][0] + 1</div><div><br></div><div>ValueError: cannot convert float NaN to integer</div></div><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​Anyone have any ideas on why this is happening?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Jon​</div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_-2288720728299154188gmail_signature"><div dir="ltr"><div><div dir="ltr">______________________________<wbr>__________________________<br>Jonathan D. Slavin                 Harvard-Smithsonian CfA<br><a href="mailto:jslavin@cfa.harvard.edu" target="_blank">jslavin@cfa.harvard.edu</a>       60 Garden Street, MS 83<br>phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981</a>       Cambridge, MA 02138-1516<br>cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035</a>             USA<br>______________________________<wbr>__________________________<br><br></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div>