select_sky_circle

gammapy.catalog.select_sky_circle(table, lon_cen, lat_cen, radius, frame='icrs', inverted=False)[source]

Select sky positions in a circle.

This function can be applied e.g. to event lists of source catalogs or observation tables.

Note: if useful we can add a function that returns the mask or indices instead of applying the selection directly

Parameters:
table : Table

Table with sky coordinate columns.

lon_cen, lat_cen : Angle

Circle center.

radius : Angle

Circle radius.

frame : str, optional

Frame in which to apply the box cut. Built-in Astropy coordinate frames are supported, e.g. ‘icrs’, ‘fk5’ or ‘galactic’.

inverted : bool, optional

Invert selection: keep all entries outside the selected region.

Returns:
table : Table

Copy of input table with circle cut applied.

Examples

>>> selected_obs_table = select_sky_circle(obs_table,
...                                        lon=Angle(0, 'deg'),
...                                        lat=Angle(0, 'deg'),
...                                        radius=Angle(5, 'deg'),
...                                        frame='galactic')