Thankyou Nathan.. thankyou very much...

On Thu 23 Feb, 2017, 9:13 PM Nathan Goldbaum, <> wrote:
On Thu, Feb 23, 2017 at 4:02 AM, Reju Sam John <> wrote:
Dear All,

I am trying to create a HaloCatalog with the following code.

import yt
from yt.analysis_modules.halo_analysis.api import HaloCatalog
data_ds = yt.load('../RD0057/RedshiftOutput0057')
hc = HaloCatalog(data_ds=data_ds, finder_method='hop', finder_kwargs={"threshold": 500.0, "dm_only": False, "ptype": "all", "padding": 0.02})
hc.add_filter("quantity_value", "particle_mass", ">", 5e12, "Msun")

With this, I am able to create the catalog. But when we are trying to load it, I am unable to get almost all fields. Here i am copying the error message. 

 File "", line 161, in <module>
    hc = HaloCatalog(halos_ds=halos)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/", line 126, in __init__
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/", line 424, in index
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/", line 481, in create_field_info
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 279, in load_all_plugins
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 292, in find_dependencies
    deps, unavailable = self.check_derived_fields(loaded)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 362, in check_derived_fields
    fd = fi.get_dependencies(ds = self.ds)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 178, in get_dependencies
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 99, in __missing__
    vv = finfo(self)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 204, in __call__
    dd = self._function(self, data)
  File "", line 72, in _fact
    tempo = Obs_freq/(1.6e6*data["MagField"]/for_mag)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 99, in __missing__
    vv = finfo(self)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 204, in __call__
    dd = self._function(self, data)
  File "", line 36, in _magfeed
    mag = (0.05*4.0*pie*data["density"]*(data["TurbVel"]**2))**0.5

The problematic line is here, in your script. You've defined a derived field but that derived field cannot be calculated for the halo catalog dataset. If you created this field using yt.add_field, then I think the solution is to create it using ds.add_field, but only for the dataset instance where this field makes sense to use.
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/", line 89, in __missing__
    finfo = self.ds._get_field_info(*field)
  File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/", line 666, in _get_field_info
    raise YTFieldNotFound((ftype, fname), self)
yt.utilities.exceptions.YTFieldNotFound: Could not find field '('all', 'density')' in catalog.0.h5.

What could be the problem?
Reju Sam John

yt-users mailing list

yt-users mailing list