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
metameta

Meta header info from Table on pointing. Passing this is deprecated, provide mode and fixed_icrs or fixed_altaz instead or use FixedPointingInfo.from_fits_header instead.

modePointingMode

How the telescope was pointing during the observation.

fixed_icrsSkyCoord, optional

The coordinates of the observation in ICRS as a SkyCoord object. Default is None. Required if mode is PointingMode.POINTING.

fixed_altazSkyCoord, optional

The coordinates of the observation in alt-az as a SkyCoord object. Default is None. Required if mode is PointingMode.DRIFT.

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

fixed_altaz

The fixed coordinates of the observation in alt-az as a SkyCoord object.

fixed_icrs

The fixed coordinates of the observation in ICRS as a SkyCoord object.

mode

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
headerastropy.fits.Header

Header to parse, e.g. from a GADF EVENTS HDU. Currently, only the GADF format is supported.

Returns
pointingFixedPointingInfo

The FixedPointingInfo instance filled from the given header.

get_altaz(obstime=None, location=None) astropy.coordinates.sky_coordinate.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
obstimeastropy.time.Time, optional

Time for which to get the pointing position in alt-az frame. Default is None.

locationastropy.coordinates.EarthLocation, optional

Observatory location, only needed for pointing observations to transform from ICRS to horizontal coordinates. Default is None.

Returns
altazastropy.coordinates.SkyCoord

Pointing position in alt-az frame.

get_icrs(obstime=None, location=None) astropy.coordinates.sky_coordinate.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
obstimeastropy.time.Time, optional

Time for which to get the pointing position in ICRS frame. Default is None.

locationastropy.coordinates.EarthLocation, optional

Observatory location, only needed for drift observations to transform from horizontal coordinates to ICRS. Default is None.

Returns
icrsastropy.coordinates.SkyCoord

Pointing position in ICRS frame.

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_infoPointingInfo

Pointing information.

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_refastropy.time.Time, optional

Reference time for storing the time related information in fits format. Default is None.

Returns
headerastropy.fits.Header

Header with fixed pointing information filled for the requested format.