On Fri, Mar 15, 2013 at 5:15 PM, Elizabeth Tasker email@example.com wrote:
When you create a projection:
projy_proj = pf.h.proj(2, 'Density', source=cloud)
is there a way of knowing the sum of the quantity that has been integrated over? (or equally, knowing the integration depth for each cell, so the total quantity can be calculated)?
I'd like to sum up the mass above a certain surface density threshold in my source, "cloud". From the above, projy_proj will tell me which regions of my cloud are above a threshold, but I can't think of an easy way to know how much mass has been summed over in that cell.
projy_average = pf.h.proj(2, "CellMass", weight_field="Ones", source=cloud) will give me an average, but not a total.
You could sum up the cell sizes:
(proj["pdx"] * 2.0)**2.sum()
Note that pdx is half-widths, so we multiply by two. This will need to be unit-converted from code to whatever.
Elizabeth _______________________________________________ yt-users mailing list firstname.lastname@example.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org