Bin 1D spherically averaged profiles uniformly on log radius

Hi all, I have been using yt.ProfilePlot to create 1D spherically averaged profiles of say the gas temperature in a simulation as a function of radius, starting from the centre of a halo out to a given radius. Does anyone know how I can bin the data uniformly in log radius? This would improve the resolution at smaller radii. It currently does not bin the data uniformly in linear or log radius. I haven't found an option with ProfilePlot for affecting the binning. Best wishes, Marco

Hi Marco, Sorry that I do not understand what you mean by saying “does not bin the data uniformly in log radius”... In ProfilePlot you can set x_log=True to get a log bin in radius (http://yt-project.org/docs/dev/reference/api/generated/yt.visualization.prof... <http://yt-project.org/docs/dev/reference/api/generated/yt.visualization.prof...>), and np.logspace will be called to get a log bin uniformly. Do you want something other than that? Best wishes, -- Suoqing JI Ph.D Candidate Department of Physics University of California, Santa Barbara http://web.physics.ucsb.edu/~suoqing
On Nov 24, 2016, at 3:39 PM, Marco Surace <marco.surace@port.ac.uk> wrote:
Hi all,
I have been using yt.ProfilePlot to create 1D spherically averaged profiles of say the gas temperature in a simulation as a function of radius, starting from the centre of a halo out to a given radius.
Does anyone know how I can bin the data uniformly in log radius? This would improve the resolution at smaller radii. It currently does not bin the data uniformly in linear or log radius. I haven't found an option with ProfilePlot for affecting the binning.
Best wishes, Marco _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

And by default, I think the radius field is always uniformly binned in log space. You can see for yourself by inspecting the underlying Profile1D object associated with the ProfilePlot: http://paste.yt-project.org/show/6946/ Here profile.x is the centers of the radius bins (profile.x_bins is the bin edges). Note how when I take the logarithm of profile.x, then subtract neighboring bin centers, I get a constant array: the bin sizes are constant in log space. -Nathan On Thu, Nov 24, 2016 at 7:16 PM, Suoqing Ji <suoqing@physics.ucsb.edu> wrote:
Hi Marco,
Sorry that I do not understand what you mean by saying “does not bin the data uniformly in log radius”... In ProfilePlot you can set x_log=True to get a log bin in radius (http://yt-project.org/docs/de v/reference/api/generated/yt.visualization.profile_plotter. ProfilePlot.html#yt.visualization.profile_plotter.ProfilePlot), and np.logspace will be called to get a log bin uniformly.
Do you want something other than that?
Best wishes, -- Suoqing JI Ph.D Candidate Department of Physics University of California, Santa Barbara http://web.physics.ucsb.edu/~suoqing
On Nov 24, 2016, at 3:39 PM, Marco Surace <marco.surace@port.ac.uk> wrote:
Hi all,
I have been using yt.ProfilePlot to create 1D spherically averaged profiles of say the gas temperature in a simulation as a function of radius, starting from the centre of a halo out to a given radius.
Does anyone know how I can bin the data uniformly in log radius? This would improve the resolution at smaller radii. It currently does not bin the data uniformly in linear or log radius. I haven't found an option with ProfilePlot for affecting the binning.
Best wishes, Marco _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

One other thing to note, especially for logarithmically spaced radial bins, it very well might be the case that there isn't any data in some o the bins at small radii. If you're worried about that, you might need to play with setting the leftmost bin edge or the bin spacing to get "nice" bins that all contain data. On Thu, Nov 24, 2016 at 8:38 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
And by default, I think the radius field is always uniformly binned in log space. You can see for yourself by inspecting the underlying Profile1D object associated with the ProfilePlot:
http://paste.yt-project.org/show/6946/
Here profile.x is the centers of the radius bins (profile.x_bins is the bin edges). Note how when I take the logarithm of profile.x, then subtract neighboring bin centers, I get a constant array: the bin sizes are constant in log space.
-Nathan
On Thu, Nov 24, 2016 at 7:16 PM, Suoqing Ji <suoqing@physics.ucsb.edu> wrote:
Hi Marco,
Sorry that I do not understand what you mean by saying “does not bin the data uniformly in log radius”... In ProfilePlot you can set x_log=True to get a log bin in radius (http://yt-project.org/docs/de v/reference/api/generated/yt.visualization.profile_plotter.P rofilePlot.html#yt.visualization.profile_plotter.ProfilePlot), and np.logspace will be called to get a log bin uniformly.
Do you want something other than that?
Best wishes, -- Suoqing JI Ph.D Candidate Department of Physics University of California, Santa Barbara http://web.physics.ucsb.edu/~suoqing
On Nov 24, 2016, at 3:39 PM, Marco Surace <marco.surace@port.ac.uk> wrote:
Hi all,
I have been using yt.ProfilePlot to create 1D spherically averaged profiles of say the gas temperature in a simulation as a function of radius, starting from the centre of a halo out to a given radius.
Does anyone know how I can bin the data uniformly in log radius? This would improve the resolution at smaller radii. It currently does not bin the data uniformly in linear or log radius. I haven't found an option with ProfilePlot for affecting the binning.
Best wishes, Marco _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
Marco Surace
-
Nathan Goldbaum
-
Suoqing Ji