.. _maxi-attitude: .. |MaxiAttitude| replace:: :class:`~gdt.missions.maxi.attitude.MaxiAttitude` .. |MaxiFrame| replace:: :class:`~gdt.missions.maxi.frame.MaxiFrame` ******************************************************* MAXI Attitude Files (:mod:`gdt.missions.maxi.attitude`) ******************************************************* The MAXI mission provides attitude files that specify the orientation of MAXI relative to the J2000 frame that is sampled at an approximate 1-s cadence over a day. We can open these files using the |MaxiAttitude| class and extract the frame information from them. For example we can read the example attitude file that is in the testing/example data: >>> from gdt.core import data_path >>> from gdt.missions.maxi.attitude import MaxiAttitude >>> att_file = data_path / 'maxi-gsc/mx_mjd58849.att.gz' >>> att = MaxiAttitude.open(att_file) >>> att To extract the MAXI frame, we do the following: >>> frame = att.get_spacecraft_frame() >>> frame Notice that this |MaxiFrame| object contains 86401 different frames, each defined at a particular ``obstime`` and with a quaternion defining the rotation between the MAXI frame and the J2000 frame. We can use this frame to do all of the things described in :ref:`MAXI Reference Frame`. For example, if we create an Astropy SkyCoord of an object on the sky, we can rotate it into each of the MAXI frames. >>> from astropy.coordinates import SkyCoord >>> coord = SkyCoord(100.0, -30.0, unit='deg') >>> maxi_coords = coord.transform_to(frame) >>> (maxi_coords.az, maxi_coords.el) , ) Or we can go in the other direction, and convert a MAXI coordinate into the celestial frame: >>> maxi_coord = SkyCoord(50.0, 25.0, frame=frame, unit='deg') >>> # convert to the Galactic frame >>> maxi_coord.galactic We can also extract a single frame or slice multiple frames: >>> frame[100] >>> frame[100:110] Note that the attitude file contains *only* the attitude information, and there is no positional information, which is contained within the orbit file and is discussed further in :ref:`MAXI Orbit Files`. See :ref:`MAXI Reference Frame` for information about how to combine the attitude and orbit information into a single |MaxiFrame| object. For more details about working with spacecraft frames, see :external:ref:`Spacecraft Attitude, Position, and Coordinates`. Reference/API ============= .. automodapi:: gdt.missions.maxi.attitude :inherited-members: