I am currently attempting to compare a catalog with Mvir and Rvir units of
Mpc/h and Kpc/h comoving to a catalog with Mpc and Kpc proper. I am
currently using yt version 3.5.1, which I just checked for updates.
When doing this conversion of units within yt, there appears to be a
problem where an amount of h*h is not handeled properly. I have included a
screenshot of a jupyter session that outlines the problem as well as a .py
and jupyter script so it can be tested.
The problem arises when I try to calculate delta_vir, which is the density
of a galaxy/ critical density. The correct value for both catalogs I am
comparing is around 170. When I use yt to calculate the critical density at
z = 2, it get the correct value, which I convert to Mpc*h*h//kpc/kpc/kpc to
match with my /h catalog. Then, when I divide the densities, even thought
their units are identical, their division is different than if just the
float values are divided, by an exact factor of h*h. I wonder if there is
something wrong with how I am initializing my values with the ytquantity,
or if there is something wrong going on in the code.
[image: Screen Shot 2019-07-31 at 2.36.01 PM.png]