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
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.B... 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_coll... 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@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@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Massimo Gaspari -
Sam Skillman