def __init__(self, config=None, tool=None, r1_product=None, extractor_product='NeighbourPeakIntegrator', cleaner_product='NullWaveformCleaner', eventsource=None, **kwargs): """ Parameters ---------- config : traitlets.loader.Config Configuration specified by config file or cmdline arguments. Used to set traitlet values. Set to None if no configuration to pass. tool : ctapipe.core.Tool or None Tool executable that is calling this component. Passes the correct logger to the component. Set to None if no Tool to pass. r1_product : str The R1 calibrator to use. Manually overrides the Factory. extractor_product : str The ChargeExtractor to use. Manually overrides the Factory. cleaner_product : str The WaveformCleaner to use. Manually overrides the Factory. eventsource : ctapipe.io.eventsource.EventSource EventSource that is being used to read the events. The EventSource contains information (such as metadata or inst) which indicates the appropriate R1Calibrator to use. kwargs """ super().__init__(config=config, tool=tool, **kwargs) extractor = ChargeExtractor.from_name( extractor_product, config=config, tool=tool ) cleaner = WaveformCleaner.from_name( cleaner_product, config=config, tool=tool, ) if r1_product: self.r1 = CameraR1Calibrator.from_name( r1_product, config=config, tool=tool, ) else: self.r1 = CameraR1Calibrator.from_eventsource( eventsource, config=config, tool=tool, ) self.dl0 = CameraDL0Reducer(config=config, tool=tool) self.dl1 = CameraDL1Calibrator(config=config, tool=tool, extractor=extractor, cleaner=cleaner)
def __init__(self, config=None, parent=None, extractor_name='NeighborPeakWindowSum', **kwargs): """ Parameters ---------- config : traitlets.loader.Config Configuration specified by config file or cmdline arguments. Used to set traitlet values. Set to None if no configuration to pass. tool : ctapipe.core.Tool or None Tool executable that is calling this component. Passes the correct logger to the component. Set to None if no Tool to pass. extractor_name : str The name of the ImageExtractor to use. kwargs """ super().__init__(config=config, parent=parent, **kwargs) extractor = ImageExtractor.from_name( extractor_name, parent=self, ) self.dl0 = CameraDL0Reducer(parent=parent) self.dl1 = CameraDL1Calibrator( parent=self, extractor=extractor, )
def setup(self): self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]" event_source = EventSource.from_config(parent=self) self.eventseeker = EventSeeker(event_source, parent=self) self.extractor = ImageExtractor.from_name( self.extractor_product, parent=self, ) self.dl0 = CameraDL0Reducer(parent=self) self.dl1 = CameraDL1Calibrator(extractor=self.extractor, parent=self)
def setup(self): self.log_format = "%(levelname)s: %(message)s [%(name)s.%(funcName)s]" kwargs = dict(config=self.config, tool=self) event_source = EventSource.from_config(**kwargs) self.eventseeker = EventSeeker(event_source, **kwargs) self.extractor = ChargeExtractor.from_name(self.extractor_product, **kwargs) self.r1 = CameraR1Calibrator.from_eventsource(eventsource=event_source, **kwargs) self.dl0 = CameraDL0Reducer(**kwargs) self.dl1 = CameraDL1Calibrator(extractor=self.extractor, **kwargs)
def __init__(self, config, tool, origin='hessio', **kwargs): """ Parameters ---------- config : traitlets.loader.Config Configuration specified by config file or cmdline arguments. Used to set traitlet values. Set to None if no configuration to pass. tool : ctapipe.core.Tool or None Tool executable that is calling this component. Passes the correct logger to the component. Set to None if no Tool to pass. origin : str The origin of the event file (default: hessio) to choose the correct `CameraR1Calibrator`. Usually given from `EventFileReader.origin`. kwargs """ super().__init__(config=config, parent=tool, **kwargs) extractor_factory = ChargeExtractorFactory(config=config, tool=tool) extractor_class = extractor_factory.get_class() extractor = extractor_class(config=config, tool=tool) cleaner_factory = WaveformCleanerFactory(config=config, tool=tool) cleaner_class = cleaner_factory.get_class() cleaner = cleaner_class(config=config, tool=tool) r1_factory = CameraR1CalibratorFactory(config=config, tool=tool, origin=origin) r1_class = r1_factory.get_class() self.r1 = r1_class(config=config, tool=tool) self.dl0 = CameraDL0Reducer(config=config, tool=tool) self.dl1 = CameraDL1Calibrator(config=config, tool=tool, extractor=extractor, cleaner=cleaner)