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 (override in subclass).

start()

Process events

Attributes Documentation

aliases: Dict[str, str] = {('i', 'input'): 'EventSource.input_url', ('o', 'output'): 'DataWriter.output_path', ('t', 'allowed-tels'): 'EventSource.allowed_tels', ('m', 'max-events'): 'EventSource.max_events', '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.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.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.reco_algorithms.StereoQualityQuery'>, <class 'ctapipe.image.modifications.ImageModifier'>, <class 'ctapipe.utils.event_type_filter.EventTypeFilter'>]
description = '\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 v3.0.0'
examples = '\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-mono-shower': ({'DataWriter': {'write_mono_shower': False}}, "don't store DL2/Event/Telescope parameters in output"), 'no-write-parameters': ({'DataWriter': {'write_parameters': False}}, "don't store DL1/Event/Telescope parameters in output"), 'no-write-stereo-shower': ({'DataWriter': {'write_stereo_shower': False}}, "don't DL2/Event/Subarray 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-mono-shower': ({'DataWriter': {'write_mono_shower': True}}, 'store DL2/Event/Telescope parameters in output'), 'write-parameters': ({'DataWriter': {'write_parameters': True}}, 'store DL1/Event/Telescope parameters in output'), 'write-stereo-shower': ({'DataWriter': {'write_stereo_shower': True}}, 'store DL2/Event/Subarray parameters in output')}
force_recompute_dl1

A boolean (True, False) trait.

force_recompute_dl2

A boolean (True, False) trait.

name = '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 (override in subclass). Here the user should construct all Components and open files, etc.

start()[source]

Process events