<div dir="ltr">I had a chance to test out an older and a newer version of yt-3 on a small dataset that has boxlen=10. This seems to confirm a boxlen**3 factor somewhere, although there's a further difference in the max density.<div>

<br></div><div>more recent version (hg id -i gives f4838a2165c0):</div><div><br></div><div>after dd = ds.all_data():</div><div><br></div><div><span class="">In [11]: </span>dd.quantities.extrema('density')</div><div>


<p class=""><span class="">Out[11]: </span>(2.00739832795e-28 g/cm**3, 4.54771338163e-24 g/cm**3)</p><p class=""><br></p><p class="">older version (hg id -i gives 3e8b733c9ee9):<br></p><p class="">after dd = ds.h.all_data():</p>

<p class=""><span class="">In [10]: </span>dd.quantities.extrema('Density')</p><p class="">








</p><p class=""><span class="">Out[10]: </span>[(2.0073983279492632e-25, 4.0079147772594363e-21)]</p></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 5:50 PM, Sam Geen <span dir="ltr"><<a href="mailto:samgeen@astro.ox.ac.uk" target="_blank">samgeen@astro.ox.ac.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yep, that looks like it should work. I'll try to run it on some particle data when I get the time, but like I said I'm 99% sure the mass units should be identical for both grid hydro and particle data.<div class="HOEnZb">

<div class="h5"><br>
<br>
On 09/05/14 17:46, Matthew Turk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sam,<br>
<br>
Okay, I've looked over a bit, and I think the correct change would be:<br>
<br>
mass_unit = rho_u * length_unit**3.<br>
<br>
That should include the correct length unit, and I think will reduce<br>
"density" back to the "unit_d" that's in the parameter file.  If this<br>
looks okay to you, I will push it, but I really do want to make sure<br>
the particle masses are correct.  Can Nick or Romain provide a bit of<br>
guidance here?<br>
<br>
-Matt<br>
<br>
On Fri, May 9, 2014 at 11:25 AM, Sam Geen <<a href="mailto:samgeen@astro.ox.ac.uk" target="_blank">samgeen@astro.ox.ac.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OK, interesting. In theory RAMSES should have identical units for both<br>
particles and gas. I can hunt down a run with particles to test if you like.<br>
<br>
Thanks!<br>
Sam<br>
<br>
<br>
On 09/05/14 17:22, Matthew Turk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sam,<br>
<br>
On reflection, I think this might be related to getting the *particle*<br>
masses correct.  I will take a look at it as soon as I can.<br>
<br>
-Matt<br>
<br>
On Fri, May 9, 2014 at 11:00 AM, Sam Geen <<a href="mailto:samgeen@astro.ox.ac.uk" target="_blank">samgeen@astro.ox.ac.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hmm, that looks like it should be "mass_unit = rho_u * length_unit**3" in<br>
line 492. You're right that it mentions the boxlength issue, though.<br>
<br>
<br>
On 09/05/14 16:50, Matthew Turk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sam,<br>
<br>
Okay, sounds good.  Looking at how code unit attributes are set up:<br>
<br>
<br>
<br>
<a href="https://bitbucket.org/yt_analysis/yt/src/a14a150c7c81850df81346162bdaff271e77eb50/yt/frontends/ramses/data_structures.py?at=yt-3.0#cl-482" target="_blank">https://bitbucket.org/yt_<u></u>analysis/yt/src/<u></u>a14a150c7c81850df81346162bdaff<u></u>271e77eb50/yt/frontends/<u></u>ramses/data_structures.py?at=<u></u>yt-3.0#cl-482</a><br>


<br>
suggests to me that length_unit takes into account boxlen, and<br>
mass_unit does not.  The comments have some indication why this might<br>
be.<br>
<br>
-Matt<br>
<br>
On Fri, May 9, 2014 at 10:46 AM, Sam Geen <<a href="mailto:samgeen@astro.ox.ac.uk" target="_blank">samgeen@astro.ox.ac.uk</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yep; both this and dd["density"] give cgs values that are too small by<br>
roughly a factor of boxlen**3.<br>
<br>
One other thing I need to try is to make sure I'm using the very latest<br>
version of YT; I've been playing around with the Ramses frontend so<br>
it's<br>
possible my version is somehow out of sync. Will let you know if this<br>
fixes<br>
things.<br>
<br>
<br>
On 09/05/14 16:42, Matthew Turk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sam,<br>
<br>
Can you verify the units are in fact incorrect in *cgs*?  Something<br>
like this would work:<br>
<br>
ds = load(...)<br>
dd = ds.all_data()<br>
print dd.quantities.total_quantitiy(<u></u>"cell_mass").in_cgs()<br>
<br>
Your second message makes me wonder if there's just a slipup in how<br>
the units are returned.<br>
<br>
-Matt<br>
<br>
On Fri, May 9, 2014 at 10:37 AM, Sam Geen <<a href="mailto:samgeen@astro.ox.ac.uk" target="_blank">samgeen@astro.ox.ac.uk</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry for the spam; a second bug I've seen is that the density and<br>
pressure<br>
unit labels on figures appears to be broken; it seems to print a<br>
latex-mangled code names for the units rather than the cgs name of<br>
the<br>
units; see attached example. Temperature is fine.<br>
<br>
<br>
On 09/05/14 16:28, Sam Geen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Just to say that in the latest version of yt-3.0 (i.e. since various<br>
fields were renamed or re-implemented), I've found a bug in the<br>
implementation of "cell_mass", which is giving results that are too<br>
low<br>
in<br>
my runs; I believe the issue is that it's missing a factor of<br>
pf["boxlen"]**3 (which is of course only a problem if boxlen is not<br>
1).<br>
The<br>
previous "CellMass_Msun" worked fine. If I get time I might take a<br>
look<br>
and<br>
issue a pull request, but otherwise I'm just flagging this in case<br>
someone<br>
else runs into problems; you can just manually multiply the result<br>
by<br>
pf["boxlen"]**3 until it's fixed.<br>
<br>
Cheers,<br>
<br>
Sam<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
<br>
</blockquote>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</div></div></blockquote></div><br></div>