yt.visualization.volume_rendering.image_handling module

yt.visualization.volume_rendering.image_handling.export_rgba(image, fn, h5=True, fits=False)[source]

This function accepts an image, of shape (N,M,4) corresponding to r,g,b,a, and saves to fn. If h5 is True, then it will save in hdf5 format. If fits is True, it will save in fits format.

yt.visualization.volume_rendering.image_handling.import_rgba(name, h5=True)[source]

This function will read back in an HDF5 file, as saved by export_rgba, and return the frames to the user. name is the name of the file to be read in.

yt.visualization.volume_rendering.image_handling.plot_channel(image, name, cmap='gist_heat', log=True, dex=3, zero_factor=1e-10, label=None, label_color='w', label_size='large')[source]

This function will plot a single channel. image is an array shaped like (N,M), name is the pefix for the output filename. cmap is the name of the colormap to apply, log is whether or not the channel should be logged. Additionally, you may optionally specify the minimum-value cutoff for scaling as dex, which is taken with respect to the minimum value of the image. zero_factor applies a minimum value to all zero-valued elements. Optionally, label, label_color and label_size may be specified.

yt.visualization.volume_rendering.image_handling.plot_rgb(image, name, label=None, label_color='w', label_size='large')[source]

This will plot the r,g,b channels of an image of shape (N,M,3) or (N,M,4). name is the prefix of the file name, which will be supplemented with “_rgb.png.” label, label_color and label_size may also be specified.