YTSelectionContainer2D.
to_frb
(width, resolution, center=None, height=None, periodic=False)[source]¶This function returns a FixedResolutionBuffer generated from this object.
A FixedResolutionBuffer 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.
Parameters: | width : width specifier
height : height specifier
resolution : int or tuple of ints
center : array-like of floats, optional
periodic : bool
|
---|---|
Returns: | frb :
|
Examples
>>> proj = ds.proj("Density", 0)
>>> frb = proj.to_frb( (100.0, 'kpc'), 1024)
>>> write_image(np.log10(frb["Density"]), 'density_100kpc.png')