yt.raven.PlotCollectionInteractive.add_profile_sphere

PlotCollectionInteractive.add_profile_sphere(*args, **kwargs)

From a description of a sphere, create a 1D, binned profile.

This function will accept the radius of a sphere, and from that it will generate a Binned1DProfile, based on the specified options. The profile will be 1D, which means while it can have an arbitrary number of fields, those fields will all be binned based on a single field.

All subsequent parameters beyond “unit” will be passed verbatim to add_profile_object.

Parameters :

radius : float

The radius of the sphere to generate.

unit : string

The unit in which the given radius is expressed.

fields : list of strings

The first element of this list is the field by which we will bin; all subsequent fields will be binned and their profiles added to the underlying BinnedProfile1D.

center : array_like, optional

The center to be used for things like radius and radial velocity. Defaults to the center of the plot collection.

weight : string, default “CellMassMsun”

The weighting field for an average. This defaults to mass-weighted averaging.

accumulation : boolean, optional

If true, from the low-value to the high-value the values in all binned fields will be accumulated. This is useful for instance when adding an unweighted CellMassMsun to a radial plot, as it will show mass interior to that radius.

x_bins : int, optional

How many bins should there be in the independent variable?

x_log : boolean, optional

Should the bin edges be log-spaced?

x_bounds : tuple of floats, optional

If specified, the boundary values for the binning. If unspecified, the min/max from the data_source will be used. (Non-zero min/max in case of log-spacing.)

lazy_reader : boolean, optional

If this is false, all of the data will be read into memory before any processing occurs. It defaults to true, and grids are binned on a one-by-one basis. Note that parallel computation requires this to be true.

id : int, optional

If specified, this will be the “semi-unique id” of the resultant plot. This should not be set.

figure : matplotlib.figure.Figure, optional

The figure onto which the axes will be placed. Typically not used unless axes is also specified.

axes : matplotlib.axes.Axes, optional

The axes object which will be used to create the image plot. Typically used for things like multiplots and the like.

Returns :

plot : yt.raven.ProfilePlot

The plot that has been added to the PlotCollection. Note that the underlying sphere may be accessed as .data.data_source

See also

yt.lagos.BinnedProfile1D
This is the object that does the transformation of raw data into a 1D profile.
yt.lagos.AMRSphereBase
This is the object auto-generated by this function.

Examples

>>> pc.add_profile_sphere(1.0, 'kpc', ["Density", "Electron_Fraction"])

This Page