<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Huh, that difference in the max density is very strange. I can't
    think why you'd have that difference; it's not an obvious multiple.<br>
    <br>
    Actually, I'm looking at the code and it's possible that the
    particle positions are scaled from 0 to boxlen and the grid
    positions from 0 to 1, though I'd need to open up the raw values in
    a RAMSES file to confirm this. If this is true, I suppose one "fix"
    could be to hard-multiply the cell sizes by pf["boxlen"] when you
    load them so that the length units are consistent for all data. I
    *think* that the older version of yt-3.0 gave correct answers,
    though, so that should at least be a way to calibrate the new
    version.<br>
    <br>
    <div class="moz-cite-prefix">On 13/05/2014 14:01, nick moeckel
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAN3J0q1YgMMF0B84QKrWEjnAQAvGVeSCboobwuv64KJUt3iFqA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <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 moz-do-not-send="true"
              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
                    moz-do-not-send="true"
                    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
                        moz-do-not-send="true"
                        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 moz-do-not-send="true"
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_analysis/yt/src/a14a150c7c81850df81346162bdaff271e77eb50/yt/frontends/ramses/data_structures.py?at=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
                            moz-do-not-send="true"
                            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("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 moz-do-not-send="true"
                                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>
                                  _______________________________________________<br>
                                  yt-users mailing list<br>
                                  <a moz-do-not-send="true"
                                    href="mailto:yt-users@lists.spacepope.org"
                                    target="_blank">yt-users@lists.spacepope.org</a><br>
                                  <a moz-do-not-send="true"
                                    href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                                    target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                                </blockquote>
                                <br>
                                <br>
                                _______________________________________________<br>
                                yt-users mailing list<br>
                                <a moz-do-not-send="true"
                                  href="mailto:yt-users@lists.spacepope.org"
                                  target="_blank">yt-users@lists.spacepope.org</a><br>
                                <a moz-do-not-send="true"
                                  href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                                  target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                                <br>
                              </blockquote>
                              _______________________________________________<br>
                              yt-users mailing list<br>
                              <a moz-do-not-send="true"
                                href="mailto:yt-users@lists.spacepope.org"
                                target="_blank">yt-users@lists.spacepope.org</a><br>
                              <a moz-do-not-send="true"
                                href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                                target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                            </blockquote>
                            <br>
                            _______________________________________________<br>
                            yt-users mailing list<br>
                            <a moz-do-not-send="true"
                              href="mailto:yt-users@lists.spacepope.org"
                              target="_blank">yt-users@lists.spacepope.org</a><br>
                            <a moz-do-not-send="true"
                              href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                              target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                          </blockquote>
                          _______________________________________________<br>
                          yt-users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:yt-users@lists.spacepope.org"
                            target="_blank">yt-users@lists.spacepope.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                            target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                        </blockquote>
                        <br>
                        _______________________________________________<br>
                        yt-users mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:yt-users@lists.spacepope.org"
                          target="_blank">yt-users@lists.spacepope.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                          target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                      </blockquote>
                      _______________________________________________<br>
                      yt-users mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:yt-users@lists.spacepope.org"
                        target="_blank">yt-users@lists.spacepope.org</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                        target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                    </blockquote>
                    <br>
                    _______________________________________________<br>
                    yt-users mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:yt-users@lists.spacepope.org"
                      target="_blank">yt-users@lists.spacepope.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                      target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                  </blockquote>
                  _______________________________________________<br>
                  yt-users mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:yt-users@lists.spacepope.org"
                    target="_blank">yt-users@lists.spacepope.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                    target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
                </blockquote>
                <br>
                _______________________________________________<br>
                yt-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:yt-users@lists.spacepope.org"
                  target="_blank">yt-users@lists.spacepope.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
                  target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
yt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>
<a class="moz-txt-link-freetext" href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>