EventSelectionOptimizer#

class ctapipe.tools.optimize_event_selection.EventSelectionOptimizer(**kwargs: Any)[source]#

Bases: Tool

Tool to create optimized cuts for IRF generation

Attributes Summary

aliases

chunk_size

How many subarray events to load at once when preselecting events.

classes

description

electron_file

Electron input filename and path.

electron_target_spectrum

Name of the spectrum used for weights of electron events.

examples

gamma_file

Gamma input filename and path

gamma_target_spectrum

Name of the spectrum used for weights of gamma events.

name

obs_time

Observation time in the form <value> <unit>.

optimization_algorithm

The cut optimization algorithm to be used.

output_path

Output file storing optimization result

proton_file

Proton input filename and path.

proton_target_spectrum

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'>]#
description: str | Unicode[str, str | bytes] = 'Tool to create optimized cuts for IRF generation'#
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.

name: str | Unicode[str, str | bytes] = 'ctapipe-optimize-event-selection'#
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

finish()[source]#

Write optimized cuts to the output file.

setup()[source]#

Initialize components from config.

start()[source]#

Load events and optimize g/h (and theta) cuts.