ProcessorTool

class ctapipe.tools.process.ProcessorTool(**kwargs: Any)[source]

Bases: ctapipe.core.tool.Tool

Process data from lower-data levels up to DL1, including both image extraction and optinally image parameterization

Attributes Summary

aliases

the alias map for configurables Keys might strings or tuples for additional options; single-letter alias accessed like -v.

classes

description

examples

flags

force_recompute_dl1

A boolean (True, False) trait.

force_recompute_dl2

A boolean (True, False) trait.

name

progress_bar

A boolean (True, False) trait.

should_calibrate

should_compute_dl1

returns true if we should compute DL1 info

should_compute_dl2

returns true if we should compute DL2 info

Methods Summary

finish()

Last steps after processing events.

setup()

Set up the tool.

start()

Process events

Attributes Documentation

aliases: Dict[str, Any] = {('i', 'input'): 'EventSource.input_url', ('o', 'output'): 'DataWriter.output_path', ('t', 'allowed-tels'): 'EventSource.allowed_tels', ('m', 'max-events'): 'EventSource.max_events', 'energy-regressor': 'ShowerProcessor.EnergyRegressor.load_path', 'particle-classifier': 'ShowerProcessor.ParticleClassifier.load_path', 'image-cleaner-type': 'ImageProcessor.image_cleaner_type'}

the alias map for configurables Keys might strings or tuples for additional options; single-letter alias accessed like -v. Values might be like “Class.trait” strings of two-tuples: (Class.trait, help-text).

classes: List[Type[Any]] = [<class 'ctapipe.calib.camera.calibrator.CameraCalibrator'>, <class 'ctapipe.io.datawriter.DataWriter'>, <class 'ctapipe.image.image_processor.ImageProcessor'>, <class 'ctapipe.reco.shower_processor.ShowerProcessor'>, <class 'ctapipe.io.metadata.Instrument'>, <class 'ctapipe.io.metadata.Contact'>, <class 'ctapipe.instrument.trigger.SoftwareTrigger'>, <class 'ctapipe.io.eventsource.EventSource'>, <class 'ctapipe.io.simteleventsource.SimTelEventSource'>, <class 'ctapipe.io.hdf5eventsource.HDF5EventSource'>, <class 'ctapipe.image.cleaning.TailcutsImageCleaner'>, <class 'ctapipe.image.cleaning.MARSImageCleaner'>, <class 'ctapipe.image.cleaning.FACTImageCleaner'>, <class 'ctapipe.image.cleaning.TimeConstrainedImageCleaner'>, <class 'ctapipe.image.extractor.FixedWindowSum'>, <class 'ctapipe.image.extractor.GlobalPeakWindowSum'>, <class 'ctapipe.image.extractor.LocalPeakWindowSum'>, <class 'ctapipe.image.extractor.SlidingWindowMaxSum'>, <class 'ctapipe.image.extractor.NeighborPeakWindowSum'>, <class 'ctapipe.image.extractor.TwoPassWindowSum'>, <class 'ctapipe.image.extractor.BaselineSubtractedNeighborPeakWindowSum'>, <class 'ctapipe.calib.camera.gainselection.ManualGainSelector'>, <class 'ctapipe.calib.camera.gainselection.ThresholdGainSelector'>, <class 'ctapipe.core.qualityquery.QualityQuery'>, <class 'ctapipe.image.image_processor.ImageQualityQuery'>, <class 'ctapipe.reco.reconstructor.StereoQualityQuery'>, <class 'ctapipe.reco.sklearn.MLQualityQuery'>, <class 'ctapipe.image.modifications.ImageModifier'>, <class 'ctapipe.utils.event_type_filter.EventTypeFilter'>, <class 'ctapipe.reco.hillas_intersection.HillasIntersection'>, <class 'ctapipe.reco.sklearn.EnergyRegressor'>, <class 'ctapipe.reco.sklearn.ParticleClassifier'>]
description: Union[str, ctapipe.core.traits.Unicode] = '\n    Process data from lower-data levels up to DL1, including both image\n    extraction and optinally image parameterization\n     This currently uses data model version v5.0.0'
examples: Union[str, ctapipe.core.traits.Unicode] = '\n    To process data with all default values:\n    > ctapipe-process --input events.simtel.gz --output events.dl1.h5 --progress\n\n    Or use an external configuration file, where you can specify all options:\n    > ctapipe-process --config stage1_config.json --progress\n\n    The config file should be in JSON or python format (see traitlets docs). For an\n    example, see ctapipe/examples/stage1_config.json in the main code repo.\n    '
flags: Dict[str, Any] = {'camera-frame': ({'ImageProcessor': {'use_telescope_frame': False}}, 'Use camera frame for image parameters instead of telescope frame'), 'f': ({'DataWriter': {'overwrite': True}}, 'Overwrite output file if it exists'), 'no-overwrite': ({'DataWriter': {'overwrite': False}}, "Don't overwrite output file if it exists"), 'no-progress': ({'ProcessorTool': {'progress_bar': False}}, "don't show a progress bar during event processing"), 'no-recompute-dl1': ({'ProcessorTool': {'force_recompute_dl1': False}}, 'Only compute DL1 if there are no DL1b parameters in the file'), 'no-recompute-dl2': ({'ProcessorTool': {'force_recompute_dl2': False}}, 'Only compute DL2 if there is no shower reconstruction in the file'), 'no-write-images': ({'DataWriter': {'write_images': False}}, "don't store DL1/Event/Telescope images in output"), 'no-write-index-tables': ({'DataWriter': {'write_index_tables': False}}, 'set DataWriter.write_index_tables=False'), 'no-write-parameters': ({'DataWriter': {'write_parameters': False}}, "don't store DL1/Event/Telescope parameters in output"), 'no-write-showers': ({'DataWriter': {'write_showers': False}}, "don't DL2/Event parameters in output"), 'overwrite': ({'DataWriter': {'overwrite': True}}, 'Overwrite output file if it exists'), 'progress': ({'ProcessorTool': {'progress_bar': True}}, 'show a progress bar during event processing'), 'recompute-dl1': ({'ProcessorTool': {'force_recompute_dl1': True}}, 'Enforce DL1 recomputation even if already present in the input file'), 'recompute-dl2': ({'ProcessorTool': {'force_recompute_dl2': True}}, 'Enforce DL2 recomputation even if already present in the input file'), 'write-images': ({'DataWriter': {'write_images': True}}, 'store DL1/Event/Telescope images in output'), 'write-index-tables': ({'DataWriter': {'write_index_tables': True}}, 'generate PyTables index tables for the parameter and image datasets'), 'write-parameters': ({'DataWriter': {'write_parameters': True}}, 'store DL1/Event/Telescope parameters in output'), 'write-showers': ({'DataWriter': {'write_showers': True}}, 'store DL2/Event parameters in output')}
force_recompute_dl1

A boolean (True, False) trait.

force_recompute_dl2

A boolean (True, False) trait.

name: Union[str, ctapipe.core.traits.Unicode] = 'ctapipe-process'
progress_bar

A boolean (True, False) trait.

should_calibrate
should_compute_dl1

returns true if we should compute DL1 info

should_compute_dl2

returns true if we should compute DL2 info

Methods Documentation

finish()[source]

Last steps after processing events.

setup()[source]

Set up the tool.

This method runs after the configuration and command line options have been parsed.

Here the tool should construct all Components, open files, etc.

start()[source]

Process events