<div class="gmail_extra">Hi Max,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Someone can correct me if I'm wrong, but I'm fairly sure that if you create a derived field, in this case XRayEmissivity, when you create a BinnedProfile it should be calculating the XRayEmissivity for each point before binning it up.  </div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Therefore I think what you would want to do is something like</div><div class="gmail_extra"><br></div><div class="gmail_extra">prof = BinnedProfile1D(data_source, n_bins, 'Radius', r_min, r_max)</div>

<div class="gmail_extra">prof.add_fields(['XRayEmissivity], weight=None, accumulation=True)</div><div class="gmail_extra"><br></div><div class="gmail_extra">The accumulation=True keyword tells it to sum it up as it goes out in radius. This makes it a cumulative distribution. </div>

<div class="gmail_extra"><br></div><div class="gmail_extra">There are some more docs on the BP1D here:</div><div class="gmail_extra"><a href="http://yt-project.org/doc/reference/api/generated/yt.data_objects.profiles.BinnedProfile1D.html#yt.data_objects.profiles.BinnedProfile1D">http://yt-project.org/doc/reference/api/generated/yt.data_objects.profiles.BinnedProfile1D.html#yt.data_objects.profiles.BinnedProfile1D</a></div>

<div class="gmail_extra"><br></div><div class="gmail_extra">including ways to write it out.  You may also want to check out the PlotCollection.add_profile_sphere:</div><div class="gmail_extra"><a href="http://yt-project.org/doc/reference/api/generated/yt.visualization.plot_collection.PlotCollection.add_profile_sphere.html#yt.visualization.plot_collection.PlotCollection.add_profile_sphere">http://yt-project.org/doc/reference/api/generated/yt.visualization.plot_collection.PlotCollection.add_profile_sphere.html#yt.visualization.plot_collection.PlotCollection.add_profile_sphere</a></div>

<div class="gmail_extra"><br></div><div class="gmail_extra">which provides a wrapper around the BinnedProfile1D object.  </div><div class="gmail_extra">  </div><div class="gmail_extra"><br></div><div class="gmail_extra">
Let us know if that works.  </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Best,</div><div class="gmail_extra">Sam</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">

<div class="gmail_quote">On Mon, Apr 23, 2012 at 9:17 AM, Massimo Gaspari <span dir="ltr"><<a href="mailto:gaspmax@hotmail.com" target="_blank">gaspmax@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">
Hi guys,<div><br></div><div>I am trying to calculate the (X-ray) luminosity within a sphere of radius r:</div><div>Lx = sum emissivity *dvol  (within r)</div><div><br></div><div>Suppose I have defined a new derived field XRayEmissivity, dependent on data['Density'] and data['Temperature'].</div>

<div><br></div><div>How would you carry out that?</div><div><br></div><div><br></div><div>I am trying to use BinnedProfile1D. However, it seems that the derived fields are computed only *after* binning, e.g.</div><div>XRayEmissivity = <Density>**2 * <Temperature>^0.5</div>

<div><br></div><div>I don't want to use the averaged quantities (in each shell). I would like to compute the emissivity point by point, for each leaf block</div><div>(very important for the luminosity).</div><div><br>

</div><div>Is it possible?</div><div><br></div><div>Thanks, as always!</div><div><br></div><div><br></div><div>  Max</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></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>