make_rgb_image

aplpy.make_rgb_image(data, output, indices=(0, 1, 2), vmin_r=None, vmax_r=None, pmin_r=0.25, pmax_r=99.75, stretch_r='linear', vmid_r=None, exponent_r=2, vmin_g=None, vmax_g=None, pmin_g=0.25, pmax_g=99.75, stretch_g='linear', vmid_g=None, exponent_g=2, vmin_b=None, vmax_b=None, pmin_b=0.25, pmax_b=99.75, stretch_b='linear', vmid_b=None, exponent_b=2, make_nans_transparent=False, embed_avm_tags=True)[source]

Make an RGB image from a FITS RGB cube or from three FITS files.

Parameters:
data : str or tuple or list

If a string, this is the filename of an RGB FITS cube. If a tuple or list, this should give the filename of three files to use for the red, green, and blue channel.

output : str

The output filename. The image type (e.g. PNG, JPEG, TIFF, …) will be determined from the extension. Any image type supported by the Python Imaging Library can be used.

indices : tuple, optional

If data is the filename of a FITS cube, these indices are the positions in the third dimension to use for red, green, and blue respectively. The default is to use the first three indices.

vmin_r, vmin_g, vmin_b : float, optional

Minimum pixel value to use for the red, green, and blue channels. If set to None for a given channel, the minimum pixel value for that channel is determined using the corresponding pmin_x argument (default).

vmax_r, vmax_g, vmax_b : float, optional

Maximum pixel value to use for the red, green, and blue channels. If set to None for a given channel, the maximum pixel value for that channel is determined using the corresponding pmax_x argument (default).

pmin_r, pmin_r, pmin_g : float, optional

Percentile values used to determine for a given channel the minimum pixel value to use for that channel if the corresponding vmin_x is set to None. The default is 0.25% for all channels.

pmax_r, pmax_g, pmax_b : float, optional

Percentile values used to determine for a given channel the maximum pixel value to use for that channel if the corresponding vmax_x is set to None. The default is 99.75% for all channels.

stretch_r, stretch_g, stretch_b : { ‘linear’, ‘log’, ‘sqrt’, ‘arcsinh’, ‘power’ }

The stretch function to use for the different channels.

vmid_r, vmid_g, vmid_b : float, optional

Baseline values used for the log and arcsinh stretches. If set to None, this is set to zero for log stretches and to vmin - (vmax - vmin) / 30. for arcsinh stretches

exponent_r, exponent_g, exponent_b : float, optional

If stretch_x is set to ‘power’, this is the exponent to use.

make_nans_transparent : bool, optional

If set AND output is png, will add an alpha layer that sets pixels containing a NaN to transparent.

embed_avm_tags : bool, optional

Whether to embed AVM tags inside the image - this can only be done for JPEG and PNG files, and only if PyAVM is installed.