[Yt-dev] HDF5 HaloFinder preloading

Stephen Skory stephenskory at yahoo.com
Sat May 9 10:33:56 PDT 2009


Hi Matt,

I'm trying to use alldata.quantities to find the total number of particles for FOF, as we've discussed before. I can't get this to work:

alldata = self.pf.h.all_data()
n_parts = alldata.quantities["TotalQuantity"](["gridNumberOfParticles"], lazy_reader=True,
    preload=True)[0]


Am I doing something wrong? Thanks!

Traceback (most recent call last):
  File "hop.py", line 7, in <module>
    hop_list_2 = FOFHaloFinder(pf,padding=0.05)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/HaloFinding.py", line 458, in __init__
    preload=True)[0]
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/DerivedQuantities.py", line 72, in __call__
    return self._call_func_lazy(args, kwargs)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/DerivedQuantities.py", line 79, in _call_func_lazy
    rv = self.func(GridChildMaskWrapper(g, self._data_source), *args, **kwargs)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/DerivedQuantities.py", line 424, in _TotalQuantity
    if data[field].size < 1:
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/DerivedQuantities.py", line 43, in __getitem__
    return self.data_source._get_data_from_grid(self.grid, item)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 39, in save_state
    tr = func(self, grid, field)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 1290, in _get_data_from_grid
    if grid[field].size == 1: # dx, dy, dz, cellvolume
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py", line 197, in __getitem__
    self.get_data(key)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/BaseGridType.py", line 96, in get_data
    self._generate_field(field)
  File "/nics/c/home/sskory/yt-cnl/lib/python2.6/site-packages/yt-1.5dev-py2.6-linux-x86_64.egg/yt/lagos/BaseGridType.py", line 66, in _generate_field
    raise exceptions.KeyError, field
KeyError: 'gridNumberOfParticles'

 _______________________________________________________
sskory at physics.ucsd.edu           o__  Stephen Skory
http://physics.ucsd.edu/~sskory/ _.>/ _Graduate Student
________________________________(_)_\(_)_______________



More information about the yt-dev mailing list