IrfTool#
- class ctapipe.tools.compute_irf.IrfTool(**kwargs: Any)[source]#
Bases:
Tool
Tool to create IRF files in GADF format
Attributes Summary
The parameterization of the angular resolution benchmark.
The parameterization of the background rate to be used.
Optional second output file for benchmarks.
How many subarray events to load at once while selecting.
Path to optimized cuts input file.
Compute background rate using supplied files.
The parameterization of the effective area to be used.
Electron input filename and path.
Name of the spectrum used for weights of electron events.
The parameterization of the bias and resolution benchmark for the energy prediction.
The parameterization of the energy dispersion to be used.
Gamma input filename and path.
Name of the spectrum used for weights of gamma events.
Observation time in the form
<value> <unit>
.Output file
Proton input filename and path.
Name of the spectrum used for weights of proton events.
The parameterization of the point spread function to be used.
Raise error if asking for IRFs outside range where cut optimisation is valid.
The parameterization of the point source sensitivity benchmark.
Compute an IRF after applying a direction cut (
SpatialSelection=RAD_MAX
)Methods Summary
calculate_selections
(reduced_events)Add the selection columns to the signal and optionally background tables.
finish
()Write the irf (and the benchmarks) to the (respective) output file(s).
setup
()Initialize components from config and load g/h (and theta) cuts.
start
()Load events and calculate the irf (and the benchmarks).
Attributes Documentation
- aliases: StrDict = {'benchmark-output': 'IrfTool.benchmarks_output_path', 'chunk_size': 'IrfTool.chunk_size', 'cuts': 'IrfTool.cuts_file', 'electron-file': 'IrfTool.electron_file', 'gamma-file': 'IrfTool.gamma_file', 'output': 'IrfTool.output_path', 'proton-file': 'IrfTool.proton_file'}#
- angular_resolution_maker_name#
The parameterization of the angular resolution benchmark.. Possible values: []
- background_maker_name#
The parameterization of the background rate to be used.. Possible values: []
- benchmarks_output_path#
Optional second output file for benchmarks.
- chunk_size#
How many subarray events to load at once while selecting.
- classes: ClassesType = [<class 'ctapipe.irf.preprocessing.EventLoader'>, <class 'ctapipe.irf.irfs.BackgroundRateMakerBase'>, <class 'ctapipe.irf.irfs.BackgroundRate2dMaker'>, <class 'ctapipe.irf.irfs.EffectiveAreaMakerBase'>, <class 'ctapipe.irf.irfs.EffectiveArea2dMaker'>, <class 'ctapipe.irf.irfs.EnergyDispersionMakerBase'>, <class 'ctapipe.irf.irfs.EnergyDispersion2dMaker'>, <class 'ctapipe.irf.irfs.PSFMakerBase'>, <class 'ctapipe.irf.irfs.PSF3DMaker'>, <class 'ctapipe.irf.benchmarks.AngularResolutionMakerBase'>, <class 'ctapipe.irf.benchmarks.AngularResolution2dMaker'>, <class 'ctapipe.irf.benchmarks.EnergyBiasResolutionMakerBase'>, <class 'ctapipe.irf.benchmarks.EnergyBiasResolution2dMaker'>, <class 'ctapipe.irf.benchmarks.SensitivityMakerBase'>, <class 'ctapipe.irf.benchmarks.Sensitivity2dMaker'>]#
- cuts_file#
Path to optimized cuts input file.
- do_background#
Compute background rate using supplied files.
- effective_area_maker_name#
The parameterization of the effective area to be used.. Possible values: []
- electron_file#
Electron input filename and path.
- electron_target_spectrum#
Name of the spectrum used for weights of electron events.
- energy_bias_resolution_maker_name#
The parameterization of the bias and resolution benchmark for the energy prediction.. Possible values: []
- energy_dispersion_maker_name#
The parameterization of the energy dispersion to be used.. Possible values: []
- examples: str | Unicode[str, str | bytes] = '\n ctapipe-compute-irf \\\n --cuts cuts.fits \\\n --gamma-file gamma.dl2.h5 \\\n --proton-file proton.dl2.h5 \\\n --electron-file electron.dl2.h5 \\\n --output irf.fits.gz \\\n --benchmark-output benchmarks.fits.gz\n '#
- flags: StrDict = {'do-background': ({'IrfTool': {'do_background': True}}, 'Compute background rate.'), 'no-do-background': ({'IrfTool': {'do_background': False}}, 'Do not compute background rate.'), 'no-spatial-selection-applied': ({'IrfTool': {'spatial_selection_applied': False}}, 'Compute an IRF without any direction cut (``SpatialSelection=None``).'), 'spatial-selection-applied': ({'IrfTool': {'spatial_selection_applied': True}}, 'Compute an IRF after applying a direction cut (``SpatialSelection=RAD_MAX``).')}#
- 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 and estimating a background rate.
- output_path#
Output file
- proton_file#
Proton input filename and path.
- proton_target_spectrum#
Name of the spectrum used for weights of proton events.
- psf_maker_name#
The parameterization of the point spread function to be used.. Possible values: []
- range_check_error#
Raise error if asking for IRFs outside range where cut optimisation is valid.
- sensitivity_maker_name#
The parameterization of the point source sensitivity benchmark.. Possible values: []
- spatial_selection_applied#
Compute an IRF after applying a direction cut (
SpatialSelection=RAD_MAX
)
Methods Documentation
- calculate_selections(reduced_events: dict) dict [source]#
Add the selection columns to the signal and optionally background tables.
- Parameters:
- reduced_events: dict
dict containing the signal (
"gammas"
) and optionally background tables ("protons"
,"electrons"
)
- Returns:
- dict
reduced_events
with selection columns added.