MongoDBTableReader
- class ctapointing.database.MongoDBTableReader(**kwargs: Any)
Bases:
TableReaderClass for reading a ctapipe.core.Container object from a Mongo database table.
Methods Summary
close()open(database_name, **kwargs)read(collection_name, containers[, ...])Returns a generator that reads the next row from the table into the given container.
Methods Documentation
- close()
- open(database_name, **kwargs)
- read(collection_name, containers, prefixes=None, selection_dict={}, limit=0)
Returns a generator that reads the next row from the table into the given container. The generator returns the same container. Note that no containers are copied, the data are overwritten inside.
- Parameters:
table_name (str) – name of table to read from
containers (ctapipe.core.Container or iterable thereof) – Container instance(s) to fill
prefixes (bool, str or iterable of str) – prefixes used during writing of the table
- __init__(database_name, **kwargs)
- Parameters:
database_name (str) – name of database table
kwargs – any other arguments that will be passed through
- read(collection_name, containers, prefixes=None, selection_dict={}, limit=0)
Returns a generator that reads the next row from the table into the given container. The generator returns the same container. Note that no containers are copied, the data are overwritten inside.
- Parameters:
table_name (str) – name of table to read from
containers (ctapipe.core.Container or iterable thereof) – Container instance(s) to fill
prefixes (bool, str or iterable of str) – prefixes used during writing of the table