GammaCatResourceIndex¶
-
class
gammapy.catalog.GammaCatResourceIndex(resources)[source]¶ Bases:
objectResource index for gamma-cat.
Parameters: resources : list
List of
GammaCatResourceobjectsAttributes Summary
global_idsList of global resource IDs ( list(str)).unique_reference_idsSorted list of unique source IDs ( list(str)).unique_source_idsSorted list of unique source IDs ( list(int)).Methods Summary
from_list(data)Create from list of dicts. from_pandas(dataframe)Create from pandas.DataFrame.from_table(table)Create from Table.query(*args, **kwargs)Query to select subset of resources. sort()Return a sorted copy (leave self unchanged). to_list()Convert to list of dict. to_pandas()Convert to pandas.DataFrame.to_table()Convert to Table.Attributes Documentation
-
global_ids¶ List of global resource IDs (
list(str)).In original order, not sorted.
-
unique_reference_ids¶ Sorted list of unique source IDs (
list(str)).
-
unique_source_ids¶ Sorted list of unique source IDs (
list(int)).
Methods Documentation
-
classmethod
from_pandas(dataframe)[source]¶ Create from
pandas.DataFrame.
-
query(*args, **kwargs)[source]¶ Query to select subset of resources.
Calls
pandas.DataFrame.queryand passes arguments to that method.Examples
>>> resource_index = GammaCatResourceIndex(...) >>> resource_index2 = resource_index.query('type == "sed" and source_id == 42')
-
to_pandas()[source]¶ Convert to
pandas.DataFrame.
-