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

On Thu, Feb 23, 2017 at 4:02 AM, Reju Sam John rejusamjohn@gmail.com 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") hc.create()
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 "tra_flux_on_earth.py", line 161, in <module> hc = HaloCatalog(halos_ds=halos) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ analysis_modules/halo_analysis/halo_catalog.py", line 126, in __init__ halos_ds.index File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ data_objects/static_output.py", line 424, in index self.create_field_info() File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ data_objects/static_output.py", line 481, in create_field_info self.field_info.load_all_plugins() File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ fields/field_info_container.py", line 279, in load_all_plugins self.find_dependencies(loaded) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ fields/field_info_container.py", line 292, in find_dependencies deps, unavailable = self.check_derived_fields(loaded) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ fields/field_info_container.py", line 362, in check_derived_fields fd = fi.get_dependencies(ds = self.ds) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 178, in get_dependencies e[self.name] File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_detector.py", line 99, in __missing__ vv = finfo(self) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 204, in __call__ dd = self._function(self, data) File "tra_flux_on_earth.py", line 72, in _fact tempo = Obs_freq/(1.6e6*data["MagField"]/for_mag) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_detector.py", line 99, in __missing__ vv = finfo(self) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 204, in __call__ dd = self._function(self, data) File "tra_flux_on_earth.py", 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/field_detector.py", line 89, in __missing__ finfo = self.ds._get_field_info(*field) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/ data_objects/static_output.py", 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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Thankyou Nathan.. thankyou very much...
On Thu 23 Feb, 2017, 9:13 PM Nathan Goldbaum, nathan12343@gmail.com wrote:
On Thu, Feb 23, 2017 at 4:02 AM, Reju Sam John rejusamjohn@gmail.com 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") hc.create()
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 "tra_flux_on_earth.py", line 161, in <module> hc = HaloCatalog(halos_ds=halos) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_catalog.py", line 126, in __init__ halos_ds.index File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 424, in index self.create_field_info() File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/static_output.py", line 481, in create_field_info self.field_info.load_all_plugins() File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_info_container.py", line 279, in load_all_plugins self.find_dependencies(loaded) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_info_container.py", line 292, in find_dependencies deps, unavailable = self.check_derived_fields(loaded) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_info_container.py", line 362, in check_derived_fields fd = fi.get_dependencies(ds = self.ds) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 178, in get_dependencies e[self.name] File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_detector.py", line 99, in __missing__ vv = finfo(self) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 204, in __call__ dd = self._function(self, data) File "tra_flux_on_earth.py", line 72, in _fact tempo = Obs_freq/(1.6e6*data["MagField"]/for_mag) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/field_detector.py", line 99, in __missing__ vv = finfo(self) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/fields/derived_field.py", line 204, in __call__ dd = self._function(self, data) File "tra_flux_on_earth.py", 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/field_detector.py", line 89, in __missing__ finfo = self.ds._get_field_info(*field) File "/home/john/anaconda3/lib/python3.6/site-packages/yt/data_objects/static_output.py", 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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Nathan Goldbaum
-
Reju Sam John