make_imagehdu

photutils.datasets.make_imagehdu(data, wcs=None)[source]

Create a FITS ImageHDU containing the input 2D image.

Parameters:
data2D array_like

The input 2D data.

wcsNone or WCS, optional

The world coordinate system (WCS) transformation to include in the output FITS header.

Returns:
image_hduImageHDU

The FITS ImageHDU.

See also

make_wcs

Examples

>>> from photutils.datasets import make_imagehdu, make_wcs
>>> shape = (100, 100)
>>> data = np.ones(shape)
>>> wcs = make_wcs(shape)
>>> hdu = make_imagehdu(data, wcs=wcs)
>>> print(hdu.data.shape)
(100, 100)