Hello Andrew,

I think, simply defining a new unit in yt would help you.

First get rho_crit (say in units g/cm**3) and z
>>> yt.define_unit("mbd", (0.048*rho_crit.d*(1+z.d)**3, "g/cm**3"))
Now you can use "mbd" (Mean Baryon Density) as normal units.
and
if you want to do it for particular data set (say 'ds') then,
>>>ds.define_unit("mbd", (0.048*rho_crit.d*(1+z.d)**3, "g/cm**3"))


Regards
-Prateek


On Thu, Jul 4, 2019 at 12:13 AM Andrew Wu <andrewmw@princeton.edu> wrote:
Hi all,

New user of yt here. I've been using yt to make some projection plots and I was wondering if there is a way to express the units of the colorbar relative to the mean baryonic density rather than in cgs, i.e. in the form 0.048*rho_crit(at z=0) * (1+z)^3 at redshift z, where rho_crit is a critical density I can calculate and the redshift z can vary depending on which file I'm making projections of. So the colorbar may range from 0.1 (times the baryonic density) to, say, 100 (times the baryonic density). What would be the best way to do this? I'm working with yt version 3.5.1 and Python 3.7.3. Any help is greatly appreciated.

Thanks,
Andrew
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org