bundles / astropy 7.0.1 / astropy / io / fits / header / Header / set
function
astropy.io.fits.header:Header.set
source: /astropy/io/fits/header.py :891
Signature
def set ( self , keyword , value = None , comment = None , before = None , after = None ) Summary
Set the value and/or comment and/or position of a specified keyword.
Extended Summary
If the keyword does not already exist in the header, a new keyword is created in the specified position, or appended to the end of the header if no position is specified.
This method is similar to Header.update prior to Astropy v0.1.
Parameters
keyword: strA header keyword
value: str, optionalThe value to set for the given keyword; if None the existing value is kept, but '' may be used to set a blank value
comment: str, optionalThe comment to set for the given keyword; if None the existing comment is kept, but
''may be used to set a blank commentbefore: str, int, optionalName of the keyword, or index of the Card before which this card should be located in the header. The argument
beforetakes precedence overafterif both specified.after: str, int, optionalName of the keyword, or index of the Card after which this card should be located in the header.
Aliases
-
astropy.io.fits.Header.set