HDUIndexTable

class gammapy.data.HDUIndexTable(data=None, masked=None, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, **kwargs)[source]

Bases: astropy.table.Table

HDU index table.

See HDU index table.

Attributes Summary

VALID_HDU_CLASS Valid values for HDU_CLASS.
VALID_HDU_TYPE Valid values for HDU_TYPE.
base_dir Base directory.
hdu_class_unique HDU classes (unique).
hdu_type_unique HDU types (unique).
obs_id_unique Observation IDs (unique).

Methods Summary

hdu_location(obs_id[, hdu_type, hdu_class]) Create HDULocation for a given selection.
location_info(idx) Create HDULocation for a given row index.
read(filename, **kwargs) Read HDU index table.
row_idx(obs_id[, hdu_type, hdu_class]) Table row indices for a given selection.
summary([file]) Print some summary info to stdout.

Attributes Documentation

VALID_HDU_CLASS = ['events', 'gti', 'aeff_2d', 'edisp_2d', 'psf_table', 'psf_3gauss', 'psf_king', 'bkg_2d', 'bkg_3d']

Valid values for HDU_CLASS.

VALID_HDU_TYPE = ['events', 'gti', 'aeff', 'edisp', 'psf', 'bkg']

Valid values for HDU_TYPE.

base_dir

Base directory.

hdu_class_unique

HDU classes (unique).

hdu_type_unique

HDU types (unique).

obs_id_unique

Observation IDs (unique).

Methods Documentation

hdu_location(obs_id, hdu_type=None, hdu_class=None)[source]

Create HDULocation for a given selection.

Parameters:

obs_id : int

Observation ID

hdu_type : str

HDU type (see VALID_HDU_TYPE)

hdu_class : str

HDU class (see VALID_HDU_CLASS)

Returns:

location : HDULocation

HDU location

location_info(idx)[source]

Create HDULocation for a given row index.

classmethod read(filename, **kwargs)[source]

Read HDU index table.

Parameters:

filename : Path, str

Filename

row_idx(obs_id, hdu_type=None, hdu_class=None)[source]

Table row indices for a given selection.

Parameters:

obs_id : int

Observation ID

hdu_type : str

HDU type (see VALID_HDU_TYPE)

hdu_class : str

HDU class (see VALID_HDU_CLASS)

Returns:

idx : list of int

List of row indices matching the selection.

summary(file=None)[source]

Print some summary info to stdout.