Cards

Card

class astropy.io.fits.Card(keyword=None, value=None, comment=None, **kwargs)[source] [edit on github]

Bases: astropy.io.fits.verify._Verify

comment

Get the comment attribute from the card image if not already set.

field_specifier

The field-specifier of record-valued keyword cards; always None on normal cards.

classmethod fromstring(image)[source] [edit on github]

Construct a Card object from a (raw) string. It will pad the string if it is not the length of a card image (80 columns). If the card image is longer than 80 columns, assume it contains CONTINUE card(s).

image

The card “image”, that is, the 80 byte character string that represents this card in an actual FITS header.

is_blank

True if the card is completely blank–that is, it has no keyword, value, or comment. It appears in the header as 80 spaces.

Returns False otherwise.

keyword

Returns the keyword name parsed from the card image.

length = 80
classmethod normalize_keyword(keyword)[source] [edit on github]

classmethod to convert a keyword value that may contain a field-specifier to uppercase. The effect is to raise the key to uppercase and leave the field specifier in its original case.

Parameters:
keyword : or str

A keyword value or a keyword.field-specifier value

rawkeyword

On record-valued keyword cards this is the name of the standard <= 8 character FITS keyword that this RVKC is stored in. Otherwise it is the card’s normal keyword.

rawvalue

On record-valued keyword cards this is the raw string value in the <field-specifier>: <value> format stored in the card in order to represent a RVKC. Otherwise it is the card’s normal value.

run_option(option='warn', err_text='', fix_text='Fixed.', fix=None, fixable=True) [edit on github]

Execute the verification with selected option.

value

The value associated with the keyword stored in this card.

verify(option='warn') [edit on github]

Verify all values in the instance.

Parameters:
option : str

Output verification option. Must be one of "fix", "silentfix", "ignore", "warn", or "exception". May also be any combination of "fix" or "silentfix" with "+ignore", +warn, or +exception" (e.g. ``"fix+warn"). See Verification options for more info.