astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- FITS File Handling (`astropy.io.fits`) »
- Cards

# Cards

## `Card`

class astropy.io.fits.Card(keyword=None, value=None, comment=None, **kwargs)

  Bases: `_Verify`

  property comment

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

  property field_specifier

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

  classmethod fromstring(image)

    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).

  property image

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

  property 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.

  property keyword

    Returns the keyword name parsed from the card image.

  length = 80

    The length of a Card image; should always be 80 for valid FITS files.

  classmethod normalize_keyword(keyword)

    `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 `python:str`

        A keyword value or a `keyword.field-specifier` value

  property 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.

  property 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)

    Execute the verification with selected option.

  property value

    The value associated with the keyword stored in this card.

  verify(option='warn')

    Verify all values in the instance.

    Parameters:
      option `python: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.