Skip to main content
`Ctrl`+`K`

# CoordinateAttribute

class astropy.coordinates.CoordinateAttribute(frame, default=None, secondary_attribute='', **kwargs)

  Bases: `Attribute`

  A frame attribute which is a coordinate object. It can be given as a `SkyCoord` or a low-level frame instance. If a low-level frame instance is provided, it will always be upgraded to be a `SkyCoord` to ensure consistent transformation behavior. The coordinate object will always be returned as a low-level frame instance when accessed.

  Parameters:
    frame `BaseCoordinateFrame` class

      The type of frame this attribute can be

    default `object`

      Default value for the attribute if not provided

    secondary_attribute `python:str`

      Name of a secondary instance attribute which supplies the value if `default is None` and no value was supplied during initialization.

    doc `python:str`

      Description of the frame attribute for help and documentation

  Methods Summary

  `convert_input`(value) | Checks that the input is a SkyCoord with the necessary units (or the special value `None`).

  Methods Documentation

  convert_input(value)

    Checks that the input is a SkyCoord with the necessary units (or the special value `None`).

    Parameters:
      value `object`

        Input value to be converted.

    Returns:
      out, converted correctly-typed `object`, bool

        Tuple consisting of the correctly-typed object and a boolean which indicates if conversion was actually performed.

    Raises:
      `ValueError`

        If the input is not valid for this attribute.