{ } Raw JSON

bundles / astropy latest / 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 : str

A header keyword

value : str, optional

The 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, optional

The comment to set for the given keyword; if None the existing comment is kept, but '' may be used to set a blank comment

before : str, int, optional

Name of the keyword, or index of the Card before which this card should be located in the header. The argument before takes precedence over after if both specified.

after : str, int, optional

Name of the keyword, or index of the Card after which this card should be located in the header.

Aliases

  • astropy.io.fits.Header.set