ProcessorTool

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

Bases: ctapipe.core.tool.Tool

Process data from lower-data levels up to DL1 and DL2, including image extraction and optionally image parameterization as well as muon analysis and shower reconstruction.

Note that the muon analysis and shower reconstruction both depend on parametrized images and therefore compute image parameters even if DataWriter.write_parameters=False in case these are not already present in the input file.

Attributes Summary

aliases

classes

description

examples

flags

force_recompute_dl1

Enforce dl1 recomputation even if already present in the input file

force_recompute_dl2

Enforce dl2 recomputation even if already present in the input file

name

progress_bar

show progress bar during processing

should_calibrate

returns true if data should be calibrated

should_compute_dl1

returns true if we should compute DL1 info

should_compute_dl2

returns true if we should compute DL2 info

should_compute_muon_parameters

returns true if we should compute muon parameters info

Methods Summary

finish()

Last steps after processing events.

setup()

Set up the tool.

start()

Process events

Attributes Documentation

aliases: Dict[Union[str, Tuple[str, ]], Union[str, Tuple[str, str]]] = {('i', 'input'): 'EventSource.input_url', ('o', 'output'): 'DataWriter.output_path', ('t', 'allowed-tels'): 'EventSource.allowed_tels', ('m', 'max-events'): 'EventSource.max_events', 'reconstructor': 'ShowerProcessor.reconstructor_types', 'image-cleaner-type': 'ImageProcessor.image_cleaner_type'}
classes: List[Type[Any]] = [<class 'ctapipe.calib.camera.calibrator.CameraCalibrator'>, <class 'ctapipe.io.datawriter.DataWriter'>, <class 'ctapipe.image.image_processor.ImageProcessor'>, <class 'ctapipe.image.muon.processor.MuonProcessor'>, <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.hdf5eventsource.HDF5EventSource'>, <class 'ctapipe.io.simteleventsource.SimTelEventSource'>, <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.FlashCamExtractor'>, <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.image.muon.processor.ImageParameterQuery'>, <class 'ctapipe.image.muon.processor.RingQuery'>, <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.sklearn.DispReconstructor'>, <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 and DL2, including image\n    extraction and optionally image parameterization as well as muon analysis\n    and shower reconstruction.\n\n    Note that the muon analysis and shower reconstruction both depend on\n    parametrized images and therefore compute image parameters even if\n    DataWriter.write_parameters=False in case these are not already present\n    in the input file.\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[Union[str, Tuple[str, ]], Tuple[Union[Dict[str, Any], traitlets.config.loader.Config], str]] = {'camera-frame': ({'ImageProcessor': {'use_telescope_frame': False}}, 'Use camera frame for image parameters instead of telescope frame'), '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-muon-parameters': ({'DataWriter': {'write_muon_parameters': False}}, "don't store DL1/Event/Telescope muon parameters in output"), '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-muon-parameters': ({'DataWriter': {'write_muon_parameters': True}}, 'store DL1/Event/Telescope muon parameters in output'), '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

Enforce dl1 recomputation even if already present in the input file

force_recompute_dl2

Enforce dl2 recomputation even if already present in the input file

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

show progress bar during processing

should_calibrate

returns true if data should be calibrated

should_compute_dl1

returns true if we should compute DL1 info

should_compute_dl2

returns true if we should compute DL2 info

should_compute_muon_parameters

returns true if we should compute muon parameters 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