make_image¶
- sofia_redux.visualization.quicklook.make_image(filename, extension=0, colormap='viridis', scale=None, n_contour=0, contour_color='gray', fill_contours=False, title='', subtitle='', subsubtitle='', crop_region=None, crop_unit='wcs', grid=False, beam=False, plot_layout=None, figure_size=None, cube_slice=None, decimal=False, watermark=None)[source]¶
Generate a map image from a FITS file.
This function generates a matplotlib Figure from imaging data in the input, for quick-look purposes. The Figure can then be displayed, added to, or saved to disk.
- Parameters:
- filenamestr or fits.HDUList
FITS file to display. May be either a file path or an astropy HDUList.
- extensionstr or int, optional
Image extension name or number to display. Default is first extension.
- colormapstr, optional
Matplotlib color map name.
- scalelist of float, optional
Low and high percentile values to use to set the image scale. Default is [0.25, 99.75].
- n_contourint, optional
Number of contours to overlay. Set to zero to turn off contour overlay.
- contour_colorstr, optional
Matplotlib color name for contours.
- fill_contoursbool, optional
Set to fill contours.
- titlestr, optional
Title for the plot.
- subtitlestr, optional
Subtitle for the plot.
- subsubtitlestr, optional
Sub-subtitle for the plot.
- crop_regionlist of float, optional
4-element list of (center_x, center_y, x_width, y_height), specified in
crop_unit
units (WCS units by default). If not specified, the full image will be displayed.- crop_unit{‘wcs’, ‘pixel’}, optional
If ‘wcs’,
crop_region
should be specified in WCS units. If ‘pixel’,crop_region
should be specified in image units.- gridbool, optional
If set, a grid will be overlaid on the image.
- beambool, optional
If set, and the BMAJ, BMIN, and BPA keywords are set in the FITS header, a beam marker is displayed on the image.
- plot_layouttuple, optional
If specified, should be (nrow, ncol). The image is placed in the first subplot in the figure; any others are left empty, for later additions to the figure.
- figure_sizetuple, optional
If specified, should be (width, height) in inches. Default is (8, 8).
- cube_sliceint, optional
If 3D data is supplied (e.g. a spectral cube), this parameter must be provided to specify the slice of the cube to display. Provided value should be a value in the first numpy index in a (nw, ny, nx) cube. This should be the last index in the associated WCS (NAXIS3).
- decimalbool, optional
If set, celestial coordinates will be displayed in decimal degrees instead of sexagesimal.
- watermarkstr, optional
If provided, the string will be added as semi-transparent text in the lower-right corner of the image.
- Returns:
- matplotlib.figure.Figure
A figure containing the image map and any additional overlays specified. The first axis contains the primary image plot.