astro py:docs

- Index
- Modules

### Navigation

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

# TimeAttribute

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

  Bases: `Attribute`

  Frame attribute descriptor for quantities that are Time objects. See the `Attribute` API doc for further information.

  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.

  Methods Summary

  `convert_input`(value) | Convert input value to a Time object and validate by running through the Time constructor.

  Methods Documentation

  convert_input(value)

    Convert input value to a Time object and validate by running through the Time constructor. Also check that the input was a scalar.

    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.