Observation

class gammapy.data.Observation(obs_id=None, obs_info=None, gti=None, aeff=None, edisp=None, psf=None, bkg=None, events=None)[source]

Bases: object

In-memory observation.

Parameters
obs_idint

Observation id

obs_infodict

Observation info dict

aeffEffectiveAreaTable2D

Effective area

edispEnergyDispersion2D

Energy dispersion

psfPSF3D

Point spread function

bkgBackground3D

Background rate model

gtiGTI

Table with GTI start and stop time

eventsEventList

Event list

Attributes Summary

fixed_pointing_info

Fixed pointing info for this observation (FixedPointingInfo).

muoneff

Observation muon efficiency.

observation_dead_time_fraction

Dead-time fraction (float).

observation_live_time_duration

Live-time duration in seconds (Quantity).

observation_time_duration

Observation time duration in seconds (Quantity).

observatory_earth_location

Observatory location (EarthLocation).

pointing_altaz

Pointing ALT / AZ sky coordinates (SkyCoord).

pointing_radec

Pointing RA / DEC sky coordinates (SkyCoord).

pointing_zen

Pointing zenith angle sky (Quantity).

target_radec

Target RA / DEC sky coordinates (SkyCoord).

tstart

Observation start time (Time).

tstop

Observation stop time (Time).

Methods Summary

create(pointing[, obs_id, livetime, tstart, …])

Create an observation.

from_caldb(pointing[, obs_id, livetime, …])

Create an observation using IRFs from a given CTA CALDB.

peek(self[, figsize])

Quick-look plots in a few panels.

Attributes Documentation

fixed_pointing_info

Fixed pointing info for this observation (FixedPointingInfo).

muoneff

Observation muon efficiency.

observation_dead_time_fraction

Dead-time fraction (float).

Defined as dead-time over observation time.

Dead-time is defined as the time during the observation where the detector didn’t record events: https://en.wikipedia.org/wiki/Dead_time https://ui.adsabs.harvard.edu/abs/2004APh….22..285F

The dead-time fraction is used in the live-time computation, which in turn is used in the exposure and flux computation.

observation_live_time_duration

Live-time duration in seconds (Quantity).

The dead-time-corrected observation time.

Computed as t_live = t_observation * (1 - f_dead) where f_dead is the dead-time fraction.

observation_time_duration

Observation time duration in seconds (Quantity).

The wall time, including dead-time.

observatory_earth_location

Observatory location (EarthLocation).

pointing_altaz

Pointing ALT / AZ sky coordinates (SkyCoord).

pointing_radec

Pointing RA / DEC sky coordinates (SkyCoord).

pointing_zen

Pointing zenith angle sky (Quantity).

target_radec

Target RA / DEC sky coordinates (SkyCoord).

tstart

Observation start time (Time).

tstop

Observation stop time (Time).

Methods Documentation

classmethod create(pointing, obs_id=0, livetime=None, tstart=None, tstop=None, irfs=None, deadtime_fraction=0.0)[source]

Create an observation.

User must either provide the livetime, or the start and stop times.

Parameters
pointingSkyCoord

Pointing position

obs_idint

Observation ID as identifier

livetime~astropy.units.Quantity`

Livetime exposure of the simulated observation

tstartQuantity

Start time of observation

tstopQuantity

Stop time of observation

irfsdict

IRFs used for simulating the observation: bkg, aeff, psf, edisp

deadtime_fractionfloat, optional

Deadtime fraction, defaults to 0

Returns
obsgammapy.data.MemoryObservation
classmethod from_caldb(pointing, obs_id=None, livetime=None, tstart=None, tstop=None, caldb='prod2', irf='South0.5hr', deadtime_fraction=0.0)[source]

Create an observation using IRFs from a given CTA CALDB.

Parameters
pointingSkyCoord

Pointing position

obs_idint

Observation ID as identifier

livetime~astropy.units.Quantity`

Livetime exposure of the simulated observation

tstartQuantity

Start time of observation

tstopQuantity

Stop time of observation

caldbstr

Calibration database

irfstr

Type of Instrumental response function.

deadtime_fractionfloat, optional

Deadtime fraction, defaults to 0

Returns
obsgammapy.data.Observation
peek(self, figsize=(12, 10))[source]

Quick-look plots in a few panels.

Parameters
figszietuple

Figure size