[yt-users] adding quantities to halo catalogs (Britton Smith)
Professor Maller
amaller at citytech.cuny.edu
Wed Jun 24 15:22:36 PDT 2015
Hi Britton,
Thanks for the help. I'm getting an error trying to use
halo.data_container.
14 hc.add_callback("sphere",factor=1.0)
15 def _gas_mass(halo):
---> 16 return
halo.data_container.quantities.total_quantity("cell_mass")
17
18 add_quantity("gas_mass",_gas_mass)
AttributeError: 'Halo' object has no attribute 'data_container'
I've made my code very simple and am using the example data to debug this.
I'm just trying to get the total gas mass for now
data_ds = yt.load('Enzo_64/RD0006/RedshiftOutput0006')
halos_ds = yt.load('rockstar_halos/halos_0.0.bin')
def _gas_mass(halo):
return halo.data_container.quantities.total_quantity("cell_mass")
add_quantity("gas_mass",_gas_mass)
# Instantiate a catalog using those two paramter files
hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds)
hc.add_callback("sphere",factor=1.0)
hc.add_quantity("gas_mass")
hc.create()
Any help would be appreciated.
Thanks,
Ari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150624/d663e663/attachment.htm>
More information about the yt-users
mailing list