yt.raven.PlotCollection.add_fixed_res_cutting_plane

PlotCollection.add_fixed_res_cutting_plane(field, normal, width, res=512, center=None, use_colorbar=True, figure=None, axes=None, fig_size=None, obj=None, field_parameters=None)

Create a fixed resolution cutting plane, from that a plot, and add it to the current collection.

A cutting plane is an oblique slice through the simulation volume, oriented by a specified normal vector that is perpendicular to the image plane. This function will slice through, but instead of retaining all the data necessary to rescale the cutting plane at any width, it only retains the pixels for a single width. This function will generate a yt.lagos.AMRFixedResCuttingPlaneBase from the given parameters. This image buffer then gets passed to a yt.raven.FixedResolutionPlot, and the resultant plot is added to the current collection. Various parameters allow control of the way the slice is displayed, as well as how the plane is generated.

Parameters :

field : string

The initial field to slice and display.

normal : array_like

The vector that defines the desired plane. For instance, the angular momentum of a sphere.

width : float

The width, in code units, of the image plane.

res : int

The returned image buffer must be square; this number is how many pixels on a side it will have.

center : array_like, optional

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

use_colorbar : bool, optional

Whether we should leave room for and create a colorbar.

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.

fig_size : tuple of floats

This parameter can act as a proxy for the manual creation of a figure. By specifying it, you can create plots with an arbitrarily large or small size. It is in inches, defaulting to 100 dpi.

obj : AMRCuttingPlaneBase, optional

If you would like to use an existing cutting plane, you may specify it here, in which case a new cutting plane will not be created.

field_parameters : dict, optional

This set of parameters will be passed to the cutting plane upon creation, which can be used for passing variables to derived fields.

Returns :

plot : yt.raven.FixedResolutionPlot

The plot that has been added to the PlotCollection.

See also

yt.lagos.AMRFixedResCuttingPlaneBase
This is the type created by this function.

Examples

Here’s a simple mechanism for getting the angular momentum of a collapsing cloud and generating a cutting plane aligned with the angular momentum vector.

>>> pf = load("RD0005-mine/RedshiftOutput0005")
>>> v, c = pf.h.find_max("Density")
>>> sp = pf.h.sphere(c, 1000.0/pf['au'])
>>> L = sp.quantities["AngularMomentumVector"]()
>>> pc = PlotCollection(pf)
>>> p = pc.add_fixed_res_cutting_plane("Density", L, 1000.0/pf['au'])

Previous topic

yt.raven.PlotCollection.add_cutting_plane

Next topic

yt.raven.PlotCollection.add_fixed_resolution_plot

This Page