cassandra_fetcher
Classes
Class to fetch data from a Cassandra database, used for Lasair integration. |
Module Contents
- class CassandraFetcher(cassandra_hosts)[source]
Class to fetch data from a Cassandra database, used for Lasair integration.
TODO: move to the lasair-adler repo.
- cassandra_hosts
Location of the Cassandra database - usually an IP address. Default is [“10.21.3.123”].
- Type:
list of str
- fetch_SSObject(ssObjectId, filter_list)[source]
Fetches the metadata from the SSObject table of a Cassandra database as a dictionary.
- Parameters:
ssObjectId (str) – ssObjectId of the object of interest.
filter_list (list of str) – A comma-separated list of the filters of interest.
- Returns:
A dictionary of metadata for the object of interest in the filters of interest.
- Return type:
dict
- fetch_MPCORB(ssObjectId)[source]
Fetches the metadata from the MPCORB table of a Cassandra database as a dictionary.
- Parameters:
ssObjectId (str) – ssObjectId of the object of interest.
- Returns:
A dictionary of metadata for the object of interest.
- Return type:
dict
- fetch_observations(ssObjectId)[source]
Fetches the source observations from the DIASource and SSSource tables as a dictionary. Note that it will retrieve ALL observations for the object regardless of filter and data range, so any filtering must be performed later. This is due to restrictions on queries to Cassandra.
- Parameters:
ssObjectId (str) – ssObjectId of the object of interest.
- Returns:
A dictionary of metadata for the object of interest in the filters of interest.
- Return type:
dict