fitsmgmt.header.hedit
fitsmgmt.header.hedit(
item,
keys,
values,
comments=None,
befores=None,
afters=None,
add=False,
output=None,
overwrite=False,
output_verify='fix',
verbose=True,
)Edit FITS header keyword values.
Parameters
item :astropyheader, path-like,~astropy.nddata.CCDData-like-
The FITS file or header to edit. If
~astropy.io.fits.Header, it is updated inplace. keys :str,list-like ofstr-
The key to edit.
values :str, numeric, orlist-like of such-
The new value. To pass one single iterable (e.g.,
[1, 2, 3]) for one singlekey, use alistof it (e.g.,[[1, 2, 3]]) to circumvent the problem. comments :str,list-like ofstr= None-
Comments to add.
add :bool, optional. = False-
Whether to add the key if it is not in the header. Default:
False. befores :str,int,list-like of such = None-
Name of the keyword, or index of the
Cardbefore which this card should be located in the header, or after which this card should be located. The argumentbeforetakes precedence overafterif both specified. Default:None. afters :str,int,list-like of such = None-
Name of the keyword, or index of the
Cardbefore which this card should be located in the header, or after which this card should be located. The argumentbeforetakes precedence overafterif both specified. Default:None. output : StrPathLike | None = None-
The output file. Default:
None.
Returns
ccd :~astropy.nddata.CCDData-
The header-updated
~astropy.nddata.CCDData.Noneifitemwas pure~astropy.io.fits.Header.