[yt-users] Index error while using covering_grid

Yang Haifeng hfyangpku at gmail.com
Sat Jan 17 12:16:24 PST 2015


Sorry, forgot the output:

level    # grids           # cells         # cells^3
----------------------------------------------
  0         1            262144                64
  1         1             24576                30
  2         1             38720                34
  3         1             98304                47
  4         1            147456                53
  5         1            327680                69
  6         1            269120                65
  7         1            403200                74
  8         1            645504                87
----------------------------------------------
            9           2216704


t = 1.06267789e-01 = 1.14972625e+12 s = 3.64326264e+04 years

Smallest Cell:
    Width: 9.890e-12 Mpc
    Width: 9.890e-06 pc
    Width: 2.040e+00 AU
    Width: 3.052e+13 cm


2015-01-17 15:16 GMT-05:00 Yang Haifeng <hfyangpku at gmail.com>:

> Hi Nathan,
>
> Here is the output of ds.print_stats(). I think it hasn't run off the edge
> yet. The refine ratio is 2 and top grid is 64*3. ad_c["Density"] will not
> produce any error.
>
> 2015-01-17 12:48 GMT-05:00 Nathan Goldbaum <nathan12343 at gmail.com>:
>
> Hi Haifeng,
>>
>> On Sat, Jan 17, 2015 at 8:55 AM, Yang Haifeng <hy4px at virginia.edu> wrote:
>>
>>> Dear yt users,
>>>
>>> I am trying to make covering_grid from an enzo simulation. The code is
>>> very simple: (somewhat sloppy since it's running with ipython. )
>>>
>>> ds=yt.load("data0201")
>>>
>>
>> What is the output of "ds.print_stats()" for this dataset?  I'm wondering
>> if your covering grid is running off the edge of the simulation domain.
>>
>>
>>> ad_c=ds.covering_grid(level=3, left_edge=0.4375, dims=[64,64,64])
>>> ad_c["x"]
>>>
>>> where the ad_c["x"] will give an Index Error on my desktop. However, the
>>> same piece of code runs great in a different machine. The version of yt are
>>> the same in both machines, which is 3.0.2. Both of them installed yt
>>> through anaconda. The error message I got was following. Thanks for your
>>> help!
>>>
>>>
>>> ---------------------------------------------------------------------------
>>> IndexError                                Traceback (most recent call
>>> last)
>>> <ipython-input-6-ff78a8bccc54> in <module>()
>>> ----> 1 ad_c["x"]
>>>
>>> /home/fxyang/software/anaconda/lib/python2.7/site-packages/yt/data_objects/data_containers.pyc
>>> in __getitem__(self, key)
>>>     243             if f in self._container_fields:
>>>     244                 self.field_data[f] = \
>>> --> 245
>>> self.ds.arr(self._generate_container_field(f))
>>>     246                 return self.field_data[f]
>>>     247             else:
>>>
>>> /home/fxyang/software/anaconda/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.pyc
>>> in _generate_container_field(self, field)
>>>     587             np.multiply(rv, self.dds[2], rv)
>>>     588         elif field == ("index", "x"):
>>> --> 589             x = np.mgrid[self.left_edge[0] + 0.5*self.dds[0]:
>>>     590                          self.right_edge[0] - 0.5*self.dds[0]:
>>>     591                          self.ActiveDimensions[0] * 1j]
>>>
>>> /home/fxyang/software/anaconda/lib/python2.7/site-packages/yt/units/yt_array.pyc
>>> in __getitem__(self, item)
>>>     981
>>>     982     def __getitem__(self, item):
>>> --> 983         ret = super(YTArray, self).__getitem__(item)
>>>     984         if ret.shape == ():
>>>     985             return YTQuantity(ret, self.units)
>>>
>>> IndexError: too many indices for array
>>>
>>>
>>> --
>>> Best,
>>> Haifeng
>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
>
> --
> Best,
> Haifeng
>



-- 
Best,
Haifeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150117/4c909d01/attachment.htm>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list