sunpy.io.fits.write(fname, data, header, hdu_type=None, **kwargs)[source]

Take a data header pair and write a FITS file.

  • fname (str) – File name, with extension.

  • data (numpy.ndarray) – n-dimensional data array.

  • header (dict) – A header dictionary.

  • hdu_type (None or CompImageHDU) – None will return a normal FITS files. CompImageHDU will rice compress the FITS file.

  • kwargs – Additional keyword arguments are given to writeto.