astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- Astronomical Coordinate Systems (`astropy.coordinates`) »
- QuantityFrameAttribute

# QuantityFrameAttribute

class `astropy.coordinates.``QuantityFrameAttribute`(default=None, secondary_attribute=u'', unit=None, shape=None)

  Bases: `astropy.coordinates.FrameAttribute`

  A frame attribute that is a quantity with specified units and shape (optionally).

  Parameters:

  default : object

  > Default value for the attribute if not provided

  secondary_attribute : str

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

  unit : unit object or None

  > Name of a unit that the input will be converted into. If None, no unit-checking or conversion is performed

  shape : tuple or None

  > If given, specifies the shape the attribute must be

  Methods Summary

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

  Methods Documentation

  `convert_input`(value)

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

    Parameters:

    value : object

    > Input value to be converted.

    Returns:

    out, converted : correctly-typed object, boolean

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