FixedPointingInfo#
- class gammapy.data.FixedPointingInfo(meta=None, *, mode=None, fixed_icrs=None, fixed_altaz=None, location=None, time_start=None, time_stop=None, time_ref=None, legacy_altaz=None)[source]#
Bases:
object
IACT array pointing info.
Data format specification: POINTING
- Parameters:
- meta
meta
Meta header info from Table on pointing. Passing this is deprecated, provide
mode
andfixed_icrs
orfixed_altaz
instead or useFixedPointingInfo.from_fits_header
instead.- mode
PointingMode
How the telescope was pointing during the observation.
- fixed_icrs
SkyCoord
, optional The coordinates of the observation in ICRS as a
SkyCoord
object. Default is None. Required if mode isPointingMode.POINTING
.- fixed_altaz
SkyCoord
, optional The coordinates of the observation in alt-az as a
SkyCoord
object. Default is None. Required if mode isPointingMode.DRIFT
.
- meta
Examples
>>> from gammapy.data import FixedPointingInfo, PointingMode >>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> fixed_icrs = SkyCoord(83.633 * u.deg, 22.014 * u.deg, frame="icrs") >>> pointing_info = FixedPointingInfo(fixed_icrs=fixed_icrs) >>> print(pointing_info) FixedPointingInfo: mode: PointingMode.POINTING coordinates: <SkyCoord (ICRS): (ra, dec) in deg (83.633, 22.014)>
Attributes Summary
The fixed coordinates of the observation in alt-az as a
SkyCoord
object.The fixed coordinates of the observation in ICRS as a
SkyCoord
object.See
PointingMode
, if not present, assume POINTING.Methods Summary
from_fits_header
(header)Parse
FixedPointingInfo
from the given FITS header.get_altaz
([obstime, location])Get the pointing position in alt-az frame for a given time.
get_icrs
([obstime, location])Get the pointing position in ICRS frame for a given time.
read
(filename[, hdu])Read pointing information table from file to obtain the metadata.
to_fits_header
([format, version, time_ref])Convert this FixedPointingInfo object into a fits header for the given format.
Attributes Documentation
- fixed_altaz#
The fixed coordinates of the observation in alt-az as a
SkyCoord
object.None if not a DRIFT observation.
- fixed_icrs#
The fixed coordinates of the observation in ICRS as a
SkyCoord
object.None if not a POINTING observation.
- mode#
See
PointingMode
, if not present, assume POINTING.
Methods Documentation
- classmethod from_fits_header(header)[source]#
Parse
FixedPointingInfo
from the given FITS header.- Parameters:
- header
astropy.fits.Header
Header to parse, e.g. from a GADF EVENTS HDU. Currently, only the GADF format is supported.
- header
- Returns:
- pointing
FixedPointingInfo
The FixedPointingInfo instance filled from the given header.
- pointing
- get_altaz(obstime=None, location=None) SkyCoord [source]#
Get the pointing position in alt-az frame for a given time.
If the observation was performed tracking a fixed position in ICRS, the icrs pointing is transformed at the given time using the location of the observation.
If the observation was performed in drift mode, the fixed alt-az coordinate is returned with
obstime
attached.- Parameters:
- obstime
astropy.time.Time
, optional Time for which to get the pointing position in alt-az frame. Default is None.
- location
astropy.coordinates.EarthLocation
, optional Observatory location, only needed for pointing observations to transform from ICRS to horizontal coordinates. Default is None.
- obstime
- Returns:
- altaz
astropy.coordinates.SkyCoord
Pointing position in alt-az frame.
- altaz
- get_icrs(obstime=None, location=None) SkyCoord [source]#
Get the pointing position in ICRS frame for a given time.
If the observation was performed tracking a fixed position in ICRS, the icrs pointing is returned with the given obstime attached.
If the observation was performed in drift mode, the fixed alt-az coordinates are transformed to ICRS using the observation location and the given time.
- Parameters:
- obstime
astropy.time.Time
, optional Time for which to get the pointing position in ICRS frame. Default is None.
- location
astropy.coordinates.EarthLocation
, optional Observatory location, only needed for drift observations to transform from horizontal coordinates to ICRS. Default is None.
- obstime
- Returns:
- icrs
astropy.coordinates.SkyCoord
Pointing position in ICRS frame.
- icrs
- classmethod read(filename, hdu='EVENTS')[source]#
Read pointing information table from file to obtain the metadata.
- Parameters:
- filenamestr
Filename.
- hduint or str, optional
HDU number or name. Default is “EVENTS”.
- Returns:
- pointing_info
PointingInfo
Pointing information.
- pointing_info
- to_fits_header(format='gadf', version='0.3', time_ref=None)[source]#
Convert this FixedPointingInfo object into a fits header for the given format.
- Parameters:
- format{“gadf”}
Format, currently only “gadf” is supported. Default is “gadf”.
- versionstr, optional
Version of the
format
, this function currently supports gadf versions 0.2 and 0.3. Default is “0.3”.- time_ref
astropy.time.Time
, optional Reference time for storing the time related information in fits format. Default is None.
- Returns:
- header
astropy.fits.Header
Header with fixed pointing information filled for the requested format.
- header