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_icrsSkyCoord in ICRS frame
Mandatory if mode is
PointingMode.POINTING
, the ICRS coordinates that are fixed for the duration of the observation.- fixed_altazSkyCoord in AltAz frame
Mandatory if mode is
PointingMode.DRIFT
, the AltAz coordinates that are fixed for the duration of the observation.
- 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(mode=PointingMode.POINTING, fixed_icrs=fixed_icrs) >>> print(pointing_info) FixedPointingInfo: mode: PointingMode.POINTING coordinates: <SkyCoord (ICRS): (ra, dec) in deg (83.633, 22.014)>
Attributes Summary
Deprecated since version 1.1.
Deprecated since version 1.1.
Deprecated since version 1.1.
The fixed coordinates in AltAz of the observation.
The fixed coordinates in ICRS of the observation.
Deprecated since version 1.1.
Deprecated since version 1.1.
See
PointingMode
, if not present, assume POINTINGDeprecated since version 1.1.
Deprecated since version 1.1.
Deprecated since version 1.1.
Deprecated since version 1.1.
Deprecated since version 1.1.
Methods Summary
from_fits_header
(header)Parse FixedPointingInfo from the given fits header
get_altaz
([obstime, location])Get the pointing position in AltAz 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
- altaz#
Deprecated since version 1.1: The altaz function is deprecated and may be removed in a future version.
ALT/AZ pointing position computed from RA/DEC (
SkyCoord
) for the midpoint of the run.Use
get_altaz
to get the pointing at a specific time, correctly handling different pointing modes.
- altaz_frame#
Deprecated since version 1.1: The altaz_frame function is deprecated and may be removed in a future version.
ALT / AZ frame (
AltAz
).
- duration#
Deprecated since version 1.1: The duration function is deprecated and may be removed in a future version.
Pointing duration (
TimeDelta
).The time difference between the TSTART and TSTOP.
- fixed_altaz#
The fixed coordinates in AltAz of the observation.
None if not a DRIFT observation
- fixed_icrs#
The fixed coordinates in ICRS of the observation.
None if not a POINTING observation
- location#
Deprecated since version 1.1: The location function is deprecated and may be removed in a future version.
Observatory location (
EarthLocation
).
- meta#
Deprecated since version 1.1: The meta function is deprecated and may be removed in a future version.
- mode#
See
PointingMode
, if not present, assume POINTING
- obstime#
Deprecated since version 1.1: The obstime function is deprecated and may be removed in a future version.
Average observation time for the observation (
Time
).
- radec#
Deprecated since version 1.1: The radec function is deprecated and may be removed in a future version.
RA/DEC pointing position from table (
SkyCoord
).Use
get_icrs
to get the pointing at a specific time, correctly handling different pointing modes.
- time_ref#
Deprecated since version 1.1: The time_ref function is deprecated and may be removed in a future version.
Reference time (
Time
).
- time_start#
Deprecated since version 1.1: The time_start function is deprecated and may be removed in a future version.
Start time (
Time
).
- time_stop#
Deprecated since version 1.1: The time_stop function is deprecated and may be removed in a future version.
Stop time (
Time
).
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 GADF is supported.
- Returns
- pointing: FixedPointingInfo
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 AltAz 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 altaz coordinate is returned with
obstime
attached.- Parameters
- obstime: `astropy.time.Time`
Time for which to get the pointing position in AltAz frame
- location: `astropy.coordinates.EarthLocation`
Observatory location, only needed for pointing observations to transform from ICRS to horizontal coordinates.
- 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 altaz coordinates are transformed to ICRS using the observation location and the given time.
- Parameters
- obstime: `astropy.time.Time`
Time for which to get the pointing position in ICRS frame
- location: `astropy.coordinates.EarthLocation`
Observatory location, only needed for drift observations to transform from horizontal coordinates to ICRS.
- classmethod read(filename, hdu='EVENTS')[source]#
Read pointing information table from file to obtain the metadata.
- Parameters
- filenamestr
File name
- hduint or str
HDU number or name
- Returns
- pointing_info
PointingInfo
Pointing info object
- 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
- formatstr
Format, currently only “gadf” is supported
- versionstr
Version of the
format
, this function currently supports gadf versions 0.2 and 0.3.- time_refastropy.time.Time or None
Reference time for storing the time related information in fits format
- Returns
- headerastropy.fits.Header
Header with fixed pointing information filled for the requested format