<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Phil,<div class=""><br class=""></div><div class="">I think you were almost there. Instead of changing the units of the plot, change them once you have the frb:</div><div class=""><br class=""></div><div class="">ds=yt.load(…)</div><div class="">prj=ds.proj(‘density’,2)</div><div class="">frb=prj.to_frb((10,’pc’),(1024,1024))</div><div class=""><br class=""></div><div class="">#now, instead of changing directly to a numpy array, first extract the field and change the units</div><div class=""><br class=""></div><div class="">dens=frb[‘density’]         #For me, this comes out in g/cm**2 already</div><div class="">dens=dens.in_units(‘kg/m**2’)     #here you can change the units to anything you want. Or just skip it if you are happy with g/cm**2</div><div class=""><br class=""></div><div class="">surfdens=np.array(dens)         <span class="Apple-tab-span" style="white-space:pre">      </span>#and here is the plotable array, in the right units.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I hope this helped,</div><div class="">Ricarda</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 10 Jun 2015, at 18:58, mc knabbits <<a href="mailto:elknabbits@googlemail.com" class="">elknabbits@googlemail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    hi, <br class="">
    I have the simple problem that I cant figure out how to change the
    units for data within a<code class=""> </code><code class="descname">YTQuadTreeProjBase.
      so I'm stuck with code units all along. heres my script part:<br class="">
      <br class="">
      <br class="">
          ds = yt.load(some ramses data)                       <br class="">
                      <br class="">
          prj = ds.proj("Density", 2)<br class="">
          prj.apply_units(arr,'g/cm**2')   #maybe it's all because I
      dont know what to put in for "arr"<br class="">
                     <br class="">
          frb=prj.to_frb((10,'pc'),(1024,1024))<br class="">
          surfdense=np.array(frb[density])<br class="">
      <br class="">
      <br class="">
          <br class="">
       as you can see the unit I need is g/cm**2 but the method applied
      above dont work!?<br class="">
      <br class="">
      thanx for your help<br class="">
      <br class="">
      phil<br class="">
    </code><code class="descname"></code>
  </div>

_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></div></body></html>