Source code for gdt.missions.gifts.frame
#
# Copyright 2026 by University College Dublin. All rights reserved.
#
# Developed by: Derek O'Callaghan
# University College Dublin
# https://www.ucd.ie/
#
# Builds on:
# Gamma-ray Data Tools - Core Components (https://github.com/USRA-STI/gdt-core)
# Gamma-ray Data Tools - Fermi mission components (https://github.com/USRA-STI/gdt-fermi/)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing permissions and limitations under the
# License.
#
from astropy.coordinates import FunctionTransform, ICRS, frame_transform_graph
from gdt.core.coords import *
from gdt.core.coords.spacecraft.frame import spacecraft_to_icrs, icrs_to_spacecraft
__all__ = ['GiftsFrame', 'gifts_to_icrs', 'icrs_to_gifts']
[docs]
class GiftsFrame(SpacecraftFrame):
"""
The GIFTS spacecraft frame in azimuth and elevation. The frame is defined
as a quaternion that represents a rotation from the GIFTS frame to the ICRS
frame. This class is a wholesale inheritance of SpacecraftFrame
Example use:
>>> from gdt.core.coords import Quaternion
>>> quat = Quaternion([-0.218, 0.009, 0.652, -0.726], scalar_first=False)
>>> gifts_frame = GiftsFrame(quaternion=quat)
>>> coord = SkyCoord(100.0, -30.0, unit='deg')
>>> az_el = SkyCoord.transform_to(gifts_frame)
"""
pass
[docs]
@frame_transform_graph.transform(FunctionTransform, GiftsFrame, ICRS)
def gifts_to_icrs(gifts_frame, icrs_frame):
"""Convert from the GIFTS frame to the ICRS frame.
Args:
fermi_frame (:class:`GiftsFrame`): The GIFTS frame
icrs_frame (:class:`astropy.coordinates.ICRS`)
Returns:
(:class:`astropy.coordinates.ICRS`)
"""
return spacecraft_to_icrs(gifts_frame, icrs_frame)
[docs]
@frame_transform_graph.transform(FunctionTransform, ICRS, GiftsFrame)
def icrs_to_gifts(icrs_frame, gifts_frame):
"""Convert from the ICRS frame to the GIFTS frame.
Args:
icrs_frame (:class:`astropy.coordinates.ICRS`)
gifts_frame (:class:`GiftsFrame`): The GIFTS frame
Returns:
(:class:`GiftsFrame`)
"""
return icrs_to_spacecraft(icrs_frame, gifts_frame)