yt.data_objects.selection_data_containers.YTCuttingPlaneBase.to_frb

YTCuttingPlaneBase.to_frb(width, resolution, height=None, periodic=False)[source]

This function returns an ObliqueFixedResolutionBuffer generated from this object.

An ObliqueFixedResolutionBuffer is an object that accepts a variable-resolution 2D object and transforms it into an NxM bitmap that can be plotted, examined or processed. This is a convenience function to return an FRB directly from an existing 2D data object. Unlike the corresponding to_frb function for other YTSelectionContainer2D objects, this does not accept a ‘center’ parameter as it is assumed to be centered at the center of the cutting plane.

Parameters:

width : width specifier

This can either be a floating point value, in the native domain units of the simulation, or a tuple of the (value, unit) style. This will be the width of the FRB.

height : height specifier, optional

This will be the height of the FRB, by default it is equal to width.

resolution : int or tuple of ints

The number of pixels on a side of the final FRB.

periodic : boolean

This can be true or false, and governs whether the pixelization will span the domain boundaries.

Returns:

frb : ObliqueFixedResolutionBuffer

A fixed resolution buffer, which can be queried for fields.

Examples

>>> v, c = ds.find_max("density")
>>> sp = ds.sphere(c, (100.0, 'au'))
>>> L = sp.quantities.angular_momentum_vector()
>>> cutting = ds.cutting(L, c)
>>> frb = cutting.to_frb( (1.0, 'pc'), 1024)
>>> write_image(np.log10(frb["Density"]), 'density_1pc.png')