%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/asdf/transform/rotate3d-1.5.0"
title: >
  Rotation in 3D space.
description: |
  Euler angle rotation around 3 axes.

  Invertibility: All ASDF tools are required to be able to compute the
  analytic inverse of this transform.

examples:
  -
    - The three Euler angles are 12.3, 34 and -1.2 in degrees.
    - asdf-standard-1.6.0
    - |
      !transform/rotate3d-1.5.0
        phi: 12.3
        theta: 34
        psi: -1.2
        direction: zxz

allOf:
  - $ref: "transform-1.4.0"
  - type: object
    properties:
      phi:
        anyOf:
          - tag: "tag:stsci.edu:asdf/unit/quantity-1.*"
          - type: number
        description: Angle, in degrees.
      theta:
        anyOf:
          - tag: "tag:stsci.edu:asdf/unit/quantity-1.*"
          - type: number
        description: Angle, in degrees.
      psi:
        anyOf:
          - tag: "tag:stsci.edu:asdf/unit/quantity-1.*"
          - type: number
        description: Angle, in degrees.
      direction:
        description: |
          Sequence of rotation axes: one of 'zxz', 'xyx', 'yzy', 'zyz', 'xzx',
          'yxy', 'xyz', 'yzx', 'zxy', 'xzy', 'zyx', 'yxz'
          or `native2celestial`, `celestial2native`.

          If `direction` is `native2celestial` or `celestial2native`,
          `phi`, `theta` are the longitude and latitude of the native pole in
          the celestial system and `psi` is the longitude of the celestial pole in
          the native system.

        enum: ['zxz', 'xyx', 'yzy', 'zyz', 'xzx', 'yxy', 'xyz', 'yzx', 'zxy',
               'xzy', 'zyx', 'yxz', native2celestial, celestial2native]
        default: native2celestial

    required: [phi, theta, psi, direction]
...
