Hello all, In the rockstar call function if you dont supply a force_res for your simulation, it runs the call if force_res is None: tds = ts[-1] # Cache a reference self.force_res = tds.index.get_smallest_dx().in_units("Mpc/h") # We have to delete now to wipe the index del tds in the runrockstar.py file in yt. However, I get an error File "./runrockstar.py", line 266, in <module> num_readers=args['num_readers']) File "./runrockstar.py", line 198, in run_rockstar particle_mass=dm_min_mass) File "/home1/sflarkin/build/yt/yt/analysis_modules/halo_finding/rockstar/rockstar.py", line 221, in __init__ self.force_res = tds.index.get_smallest_dx().in_units("Mpc/h") P014 yt : [ERROR ] 2018-07-20 13:58:08,873 AttributeError: 'numpy.float64' object has no attribute 'in_units' I am not sure what is causing this, I have been looking in my fields for a problem but do not see any.
It appears that the simulation files I am using do not have a unit property according to the dir() of the field. However, when I used the call without in_units, it works properly. How important is the .in_units to the package. Is it okay to run without that information attached?
Hi,
It's probably a good idea to keep the unit conversion in there as Rockstar
specifically deals in Mpc/h and the get_smallest_dx function is not likely
to return in those units. I think it would be safer to get unit support
working with get_smallest_dx for your type of simulation data. The value
being returned for your data is probably not in Mpc/h.
As a quick workaround, you can compute the proper value of force_res in
Mpc/h yourself and pass it as a keyword.
Britton
On Fri, Jul 20, 2018 at 2:43 PM
It appears that the simulation files I am using do not have a unit property according to the dir() of the field. However, when I used the call without in_units, it works properly. How important is the .in_units to the package. Is it okay to run without that information attached? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (2)
-
Britton Smith
-
sflarkin@ucsc.edu