fits#

Methods for reading and writing FITS files.

hsr4hci.fits.read_fits(file_path: Union[Path, str], return_header: Literal[True]) Tuple[ndarray, dict][source]#
hsr4hci.fits.read_fits(file_path: Union[Path, str], return_header: Literal[False]) ndarray

Open a FITS file and return its contents as a numpy array.

Parameters:
  • file_path โ€“ Path of the FITS file to be read in.

  • return_header โ€“ Whether to return the FITS header.

Returns:

A numpy array containing the contents of the given FITS file. Optionally also a dictionary containing the FITS header.

hsr4hci.fits.save_fits(array, file_path, header=None, overwrite=True)[source]#

Save a numpy array as a FITS file.

Parameters:
  • array (ndarray) โ€“ The numpy array to be saved to a FITS file.

  • file_path (Union[Path, str]) โ€“ The path where to save the FITS file.

  • header (Optional[dict]) โ€“ A dictionary with additional header information.

  • overwrite (bool) โ€“ Whether to overwrite an existing FITS file.

Return type:

None