EventSelectionOptimizer#
- class ctapipe.tools.optimize_event_selection.EventSelectionOptimizer(**kwargs: Any)[source]#
Bases:
Tool
Tool to create optimized cuts for IRF generation
Attributes Summary
How many subarray events to load at once when preselecting events.
Electron input filename and path.
Name of the spectrum used for weights of electron events.
Gamma input filename and path
Name of the spectrum used for weights of gamma events.
Observation time in the form
<value> <unit>
.The cut optimization algorithm to be used.
Output file storing optimization result
Proton input filename and path.
Name of the spectrum used for weights of proton events.
Methods Summary
finish
()Write optimized cuts to the output file.
setup
()Initialize components from config.
start
()Load events and optimize g/h (and theta) cuts.
Attributes Documentation
- aliases: StrDict = {'chunk_size': 'EventSelectionOptimizer.chunk_size', 'electron-file': 'EventSelectionOptimizer.electron_file', 'gamma-file': 'EventSelectionOptimizer.gamma_file', 'output': 'EventSelectionOptimizer.output_path', 'proton-file': 'EventSelectionOptimizer.proton_file'}#
- chunk_size#
How many subarray events to load at once when preselecting events.
- classes: ClassesType = [<class 'ctapipe.irf.preprocessing.EventLoader'>, <class 'ctapipe.irf.optimize.CutOptimizerBase'>, <class 'ctapipe.irf.optimize.PercentileCuts'>, <class 'ctapipe.irf.optimize.GhPercentileCutCalculator'>, <class 'ctapipe.irf.optimize.ThetaPercentileCutCalculator'>, <class 'ctapipe.irf.optimize.PointSourceSensitivityOptimizer'>, <class 'ctapipe.irf.optimize.ThetaPercentileCutCalculator'>]#
- electron_file#
Electron input filename and path. Not needed, if
optimization_algorithm = 'PercentileCuts'
.
- electron_target_spectrum#
Name of the spectrum used for weights of electron events.
- examples: str | Unicode[str, str | bytes] = '\n ctapipe-optimize-event-selection \\\n --gamma-file gamma.dl2.h5 \\\n --proton-file proton.dl2.h5 \\\n --electron-file electron.dl2.h5 \\\n --output cuts.fits\n '#
- gamma_file#
Gamma input filename and path
- gamma_target_spectrum#
Name of the spectrum used for weights of gamma events.
- obs_time#
Observation time in the form
<value> <unit>
. This is used for flux normalization when calculating sensitivities.
- optimization_algorithm#
The cut optimization algorithm to be used.. Possible values: []
- output_path#
Output file storing optimization result
- proton_file#
Proton input filename and path. Not needed, if
optimization_algorithm = 'PercentileCuts'
.
- proton_target_spectrum#
Name of the spectrum used for weights of proton events.
Methods Documentation