yt.raven.FixedResolutionBuffer.__init__

FixedResolutionBuffer.__init__(data_source, bounds, buff_size, antialias = True)

This accepts a 2D data object, such as a Projection or Slice, and implements a protocol for generating a pixelized, fixed-resolution image buffer.

yt stores 2D AMR data internally as a set of 2D coordinates and the half-width of individual pixels. Converting this to an image buffer requires a deposition step, where individual variable-resolution pixels are deposited into a buffer of some resolution, to create an image. This object is an interface to that pixelization step: it can deposit multiple fields. It acts as a standard AMRData object, such that dict-style access returns an image of a given field.

Parameters :

data_source : yt.lagos.AMRProjBase or yt.lagos.AMRSliceBase

This is the source to be pixelized, which can be a projection or a slice. (For cutting planes, see yt.raven.ObliqueFixedResolutionBuffer.)

bounds : sequence of floats

Bounds are the min and max in the image plane that we want our image to cover. It’s in the order of (xmin, xmax, ymin, ymax), where the coordinates are all in the appropriate code units.

buff_size : sequence of ints

The size of the image to generate.

antialias : boolean

This can be true or false. It determines whether or not sub-pixel rendering is used during data deposition.

See also

yt.raven.ObliqueFixedResolutionBuffer
A similar object, used for cutting planes.

Examples

To make a projection and then several images, you can generate multiple images.

>>> proj = pf.h.slice(0, "Density")
>>> frb1 = FixedResolutionBuffer(proj, (0.2, 0.3, 0.4, 0.5),
                (1024, 1024))
>>> print frb1["Density"].max()
1.0914e-9
>>> print frb1["Temperature"].max()
104923.1

This Page