write_header_file_from_image_file#

sunpy.data.test.write_header_file_from_image_file(image_path, header_path, hdu=0, **kwargs)[source]#

Convert a FITS file containing an image and a header to a plaintext file containing only the string representation of the header.

This is to be used in the context of generating header-only test data files.

Parameters:
  • image_path (path-like) – Path to original image data FITS file

  • header_path (path-like) – Path to header-only test data plaintext file

  • hdu (int, optional) – HDU index of the header to write the header for

  • Additional Parameters

  • ———————

  • Keyword arguments accepted by `~astropy.io.fits.Header.totextfile`