astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v5.2.1 »
- Astronomical Coordinate Systems (`astropy.coordinates`) »
- CartesianRepresentationAttribute

# CartesianRepresentationAttribute

class astropy.coordinates.CartesianRepresentationAttribute(default=None, secondary_attribute='', unit=None)

  Bases: `Attribute`

  A frame attribute that is a CartesianRepresentation with specified units.

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

    unit astropy:unit-like or `python:None`

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

  Methods Summary

  `convert_input`(value) | Checks that the input is a CartesianRepresentation with the correct unit, or the special value `[0, 0, 0]`.

  Methods Documentation

  convert_input(value)

    Checks that the input is a CartesianRepresentation with the correct unit, or the special value `[0, 0, 0]`.

    Parameters:
      value `object`

        Input value to be converted.

    Returns:
      out `object`

        The correctly-typed object.

      converted bool

        A boolean which indicates if conversion was actually performed.

    Raises:
      `ValueError`

        If the input is not valid for this attribute.