[yt-users] Luminosity within r

Sam Skillman samskillman at gmail.com
Mon Apr 23 08:35:11 PDT 2012


Hi Max,

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.

Therefore I think what you would want to do is something like

prof = BinnedProfile1D(data_source, n_bins, 'Radius', r_min, r_max)
prof.add_fields(['XRayEmissivity], weight=None, accumulation=True)

The accumulation=True keyword tells it to sum it up as it goes out in
radius. This makes it a cumulative distribution.

There are some more docs on the BP1D here:
http://yt-project.org/doc/reference/api/generated/yt.data_objects.profiles.BinnedProfile1D.html#yt.data_objects.profiles.BinnedProfile1D

including ways to write it out.  You may also want to check out the
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

which provides a wrapper around the BinnedProfile1D object.


Let us know if that works.

Best,
Sam



On Mon, Apr 23, 2012 at 9:17 AM, Massimo Gaspari <gaspmax at hotmail.com>wrote:

>  Hi guys,
>
> I am trying to calculate the (X-ray) luminosity within a sphere of radius
> r:
> Lx = sum emissivity *dvol  (within r)
>
> Suppose I have defined a new derived field XRayEmissivity, dependent on
> data['Density'] and data['Temperature'].
>
> How would you carry out that?
>
>
> I am trying to use BinnedProfile1D. However, it seems that the derived
> fields are computed only *after* binning, e.g.
> XRayEmissivity = <Density>**2 * <Temperature>^0.5
>
> 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
> (very important for the luminosity).
>
> Is it possible?
>
> Thanks, as always!
>
>
>   Max
>
>
>
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120423/691b9551/attachment.htm>


More information about the yt-users mailing list