setval(filename, keyword, *args, value=None, comment=None, before=None, after=None, savecomment=False, **kwargs)
If the keyword already exists, it's value/comment will be updated. If it does not exist, a new card will be created and it will be placed before or after the specified location. If no before
or after
is specified, it will be appended at the end.
When updating more than one keyword in a file, this convenience function is a much less efficient approach compared with opening the file for update, modifying the header, and closing the file.
Name of the FITS file, or file object If opened, mode must be update (rb+). An opened file object or GzipFile
object will be closed upon return.
Keyword name
Keyword value (default: :None:None:`None`
, meaning don't modify)
Keyword comment, (default: :None:None:`None`
, meaning don't modify)
Name of the keyword, or index of the card before which the new card will be placed. The argument before
takes precedence over after
if both are specified (default: :None:None:`None`
).
Name of the keyword, or index of the card after which the new card will be placed. (default: :None:None:`None`
).
When :None:None:`True`
, preserve the current comment for an existing keyword. The argument savecomment
takes precedence over comment
if both specified. If comment
is not specified then the current comment will automatically be preserved (default: :None:None:`False`
).
The rest of the arguments are for extension specification. See getdata
for explanations/examples.
Any additional keyword arguments to be passed to astropy.io.fits.open
. Note: This function automatically specifies do_not_scale_image_data
= True
when opening the file so that values can be retrieved from the unmodified header.
Set a keyword's value from a header in a FITS file.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them