MongoDBTableWriter
- class ctapointing.database.MongoDBTableWriter(**kwargs: Any)
Bases:
TableWriterClass for writing ~ctapipe.core.Container objects to a mongo database table
Methods Summary
close()Close open writer
open(filename, **kwargs)open an output file
write(collection_name, containers[, replace])Write the contents of the given container or containers to a MongoDB table.
Methods Documentation
- close()
Close open writer
- open(filename, **kwargs)
open an output file
- Parameters:
filename (str) – output file name
kwargs – any extra args to pass to the subclass open method
- write(collection_name, containers, replace=False)
Write the contents of the given container or containers to a MongoDB table. :param collection_name: name of collection within the database to write to :type collection_name: str :param containers: container to write :type containers: ctapipe.core.Container or Iterable[ctapipe.core.Container] :param replace: :type replace: replace table entry in database if already existing
- __init__(database_name, add_prefix=False, parent=None, config=None)
- Parameters:
config (traitlets.loader.Config) – Configuration specified by config file or cmdline arguments. Used to set traitlet values.
parent (Tool or Component) – If a Component is created by another Component or Tool, you need to pass the creating Component as parent, e.g. parent=self. This makes sure the config is correctly handed down to the child components. Do not pass config in this case.
kwargs – Traitlets to be overridden. TraitError is raised if kwargs contains a key that does not correspond to a traitlet.
- close()
Close open writer
- open(filename, **kwargs)
open an output file
- Parameters:
filename (str) – output file name
kwargs – any extra args to pass to the subclass open method
- write(collection_name, containers, replace=False)
Write the contents of the given container or containers to a MongoDB table. :param collection_name: name of collection within the database to write to :type collection_name: str :param containers: container to write :type containers: ctapipe.core.Container or Iterable[ctapipe.core.Container] :param replace: :type replace: replace table entry in database if already existing