Wait.  No, I think the correct terminology is:<div><br></div><div>Density is the value (v).  Density is the weight (w).  L comes in through the dz.</div><div><br></div><div>The units of a density-weighted projection of density is density. </div>

<div><br></div><div>Sam<br><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 3:36 PM, John ZuHone <span dir="ltr"><<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Yes, that's right. For myself, I prefer to weigh density by volume or by "ones", depending on the situation.<div><div class="h5"><div><br><div><div><div><div>On Jun 11, 2012, at 5:32 PM, Geoffrey So wrote:</div>

<br><blockquote type="cite">So the weighted projection of density would use "density" as the value and "density * L" as the weight, and return units of Density?<div><br></div><div>From</div><div>G.S.<br>

<br><div class="gmail_quote">
On Mon, Jun 11, 2012 at 2:30 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:goldbaum@ucolick.org" target="_blank">goldbaum@ucolick.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word"><div>Hi Geoffrey,</div><div><br></div><div>Well, if you look at Sam's formula and convert it into the discrete version, what you're really doing is:</div><div><br></div><div>(Density1**2 * L1 + Density2**2 * L2 +...)/(Density1*L1 + Density2*L2 + ...) =  units of g/cm^3</div>


<div><br></div><div>Unweighted projections always have column density units.  So, if you're projecting a field with units of T-rex, you'll get back an image with units of T-rex*cm.</div><div><br></div><div>Hope that helped,</div>


<br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


Nathan Goldbaum<br>Graduate Student<br>Astronomy & Astrophysics, UCSC<br><a href="mailto:goldbaum@ucolick.org" target="_blank">goldbaum@ucolick.org</a><br><a href="http://www.ucolick.org/~goldbaum" target="_blank">http://www.ucolick.org/~goldbaum</a></div>


</span></div></span></div></span></span>
</div>
<br><div><div><div><div>On Jun 11, 2012, at 2:27 PM, Geoffrey So wrote:</div><br></div></div><blockquote type="cite"><div><div>Thanks for the explanations, but I think I'm still confused about something and want a bit more clarifications,<div>


<br></div><div>I thought when I'm projecting density, I'm doing (Density1 + Density2 +...), which is obviously wrong because I forgot about the Length dimention, so it should be:</div>
<div><br></div><div>Density1 * L1 + Density2 * L2 + ... = units of g/cm^2</div><div><br></div><div>When I'm projecting density with density as weight, I would think I would then be doing:</div><div><br></div><div>(Density1**2 * L1 + Density2**2 * L2 +...)/(Density1 + Density2 + ...) =  units of g/cm^2</div>



<div><br></div><div>But according to Sam, the units of weighted should be g/cm^3, where the role of v and w is switched.  "v": O(Density) is the value, and "w": O(Density)*O(L) is the weight.  And thus we get a projection weighted Density cell value in units of g/cm^3 instead of g/cm^2.  Shouldn't the weighting not change the units, or am I confusing projection weighted density with density weighted projection?</div>



<div><br></div><div>I've never done unweighted projections, so I kept using the units of the field (g/cm^3 in case of Density), those units seems right or have I been wrong all along?</div><div><br></div><div>From</div>



<div>G.S.</div><div><br></div><br><div class="gmail_quote">On Mon, Jun 11, 2012 at 1:32 PM, Sam Skillman <span dir="ltr"><<a href="mailto:samskillman@gmail.com" target="_blank">samskillman@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Geoffrey, if it helps, in the continuum limit, a weighted projection along the z direction is (v is the field, w is the weight):</div>



<img alt="Inline image 1"><br><div>whereas unweighted is:</div>


<div><img alt="Inline image 4"><br>
For your example, the order of magnitude of your result would be O(density)**2*O(L)/O(density)*O(L) = O(density) for the weighted projection.  The unweighted is just O(density)*O(L).</div><span><font color="#888888"><div>



<br></div></font></span><div><span><font color="#888888">Sam</font></span><div><div><br><br><div class="gmail_quote">



On Mon, Jun 11, 2012 at 2:12 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







Hi Geoffrey,<br>
<div><div><br>
On Mon, Jun 11, 2012 at 4:10 PM, Geoffrey So <<a href="mailto:gsiisg@gmail.com" target="_blank">gsiisg@gmail.com</a>> wrote:<br>
> Hi, sorry for asking a dumb question, but when I do a projection of density<br>
><br>
> field = "Density"<br>
> proj = pf.h.proj(direction, field, weight_field=field)<br>
><br>
> the numbers I get are ~1e-28<br>
><br>
> but when I do<br>
> proj = pf.h.proj(direction, field, weight_field=None)<br>
><br>
> the numbers become ~1e-4<br>
><br>
> this is a 64 cube simulation, if I were to multiply 64 * 1e-28 for a<br>
> projection with no weighting, shouldn't I still get numbers on the order of<br>
> 1e-26 or 1e-27?  I'm guessing there's something I've misunderstood about<br>
> pf.h.proj.  Am I missing like a CGS conversion factor when I don't weight it<br>
> by some field?<br>
<br>
</div></div>Nope, weighting means to take the average with respect to some other<br>
field.  So when you don't weight it, you don't take an average, you<br>
get a line integral.  It's probably different by a factor of roughly<br>
the same OOM as the number of centimeters your box is across.<br>
<br>
-Matt<br>
<br>
><br>
> From<br>
> G.S.<br>
><br>
> _______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div></div>


!DSPAM:10175,4fd662c1169022337211186!
_______________________________________________<div><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/listinfo.cgi/yt-users-spacepope.org</a><br>


<br><br></div>!DSPAM:10175,4fd662c1169022337211186!<br></blockquote></div><br></div><br>_______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
_______________________________________________<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/listinfo.cgi/yt-users-spacepope.org</a><br>

</blockquote></div><br></div></div></div></div></div></div><br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">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/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>