yt.visualization.fixed_resolution.
FixedResolutionBuffer
(data_source, bounds, buff_size, antialias = True)[source]¶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 :
bounds : sequence of floats
buff_size : sequence of ints
antialias : boolean
periodic : boolean
|
---|
See also
yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer
Examples
To make a projection and then several images, you can generate a single FRB and then access multiple fields:
>>> proj = ds.proj(0, "density")
>>> frb1 = FixedResolutionBuffer(proj, (0.2, 0.3, 0.4, 0.5),
... (1024, 1024))
>>> print frb1["density"].max()
1.0914e-9 g/cm**3
>>> print frb1["temperature"].max()
104923.1 K
Methods