read_header_keywords

raccoon.fitsutils.read_header_keywords(filin, kws, notfound=nan, ext=0, names=None)

Read keywords in kws from FITS header.

Parameters:
filinstr or astropy header object (astropy.io.fits.header.Header)

FITS file from which to read the header or astropy header object (faster if header already loaded before). If it is a header object, the parameter ext is not used.

kwsstr or list-like
notfoundany (default np.nan)

Value to write in the output if the keyword is not found in the header.

extint, str (default 0)

Extension of the FITS from which to get the header.

namesdict

Names for the output dictionary keys, to substitute the original header keywords. E.g. names={‘oldk: ‘newk}. Must contain all the keywords in kws. If not a dictionary or old keywords not correct, no change is made.

Returns:
datadict