Hi Sina, Rather than delete the unit conversion step, this might work if you add units to your particle mass array before calling the halo finder. I'm not sure how you're doing things, but if you have some array, mass, then you should be able to do: import yt mass = yt.YTArray(mass, 'Msun') or whatever units your masses are in. I don't totally understand the error your seeing with everything coming back as -1, but this may help. Anyway, please report back or feel free to come onto the slack #help channel. Britton On Tue, Aug 6, 2019 at 8:12 AM Sina Hooshangi <sina.hooshangi@gmail.com> wrote:
Dear Prateek,
The error message is: " File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_finding_methods.py", line 117, in _parse_old_halo_list halo_properties['particle_mass'][0][i] = halo.virial_mass().in_cgs() AttributeError: 'int' object has no attribute 'in_cgs'
" when I deleted the "in_cgs()" part, there is no error but the particle positions are all zero and the virial mass and virial radius are all -1.
Here is the full error message:
""" Number of initial groups:51218 Number of groups:643 FOF CPU TIME: 0.049968 secs yt : [INFO ] 2019-08-06 15:33:28,674 Parsing outputs yt : [WARNING ] 2019-08-06 15:33:28,728 Field ('all', 'particle_mass') was added without specifying units, assuming units are g ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error.
Traceback (most recent call last): File "/home/sina/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-5-6b9262d90adc>", line 1, in <module> hc.create() File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_catalog.py", line 337, in create self._run(save_halos, save_catalog, njobs=njobs, dynamic=dynamic) File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 301, in barrierize return func(*args, **kwargs) File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_catalog.py", line 406, in _run self.halos_ds = self.finder_method(self.data_ds) File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_finding_methods.py", line 44, in __call__ return self.function(ds, *self.args, **self.kwargs) File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_finding_methods.py", line 62, in _fof_method halos_ds = _parse_old_halo_list(ds, halo_list) File "/home/sina/anaconda3/lib/python3.6/site-packages/yt/analysis_modules/halo_analysis/halo_finding_methods.py", line 117, in _parse_old_halo_list halo_properties['particle_mass'][0][i] = halo.virial_mass().in_cgs() AttributeError: 'int' object has no attribute 'in_cgs'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/sina/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 1863, in showtraceback stb = value._render_traceback_() AttributeError: 'AttributeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/sina/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 1095, in get_records return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset) File "/home/sina/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 311, in wrapped return f(*args, **kwargs) File "/home/sina/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 345, in _fixed_getinnerframes records = fix_frame_records_filenames(inspect.getinnerframes(etb, context)) File "/home/sina/anaconda3/lib/python3.6/inspect.py", line 1490, in getinnerframes frameinfo = (tb.tb_frame,) + getframeinfo(tb, context) File "/home/sina/anaconda3/lib/python3.6/inspect.py", line 1448, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/home/sina/anaconda3/lib/python3.6/inspect.py", line 696, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/home/sina/anaconda3/lib/python3.6/inspect.py", line 742, in getmodule os.path.realpath(f)] = module.__name__ AttributeError: module has no attribute '__name__' """
Best, Sina _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org