IrfTool#

class ctapipe.tools.compute_irf.IrfTool(**kwargs: Any)[source]#

Bases: Tool

Tool to create IRF files in GADF format

Attributes Summary

aliases

angular_resolution_maker_name

The parameterization of the angular resolution benchmark.

background_maker_name

The parameterization of the background rate to be used.

benchmarks_output_path

Optional second output file for benchmarks.

chunk_size

How many subarray events to load at once while selecting.

classes

cuts_file

Path to optimized cuts input file.

description

do_background

Compute background rate using supplied files.

effective_area_maker_name

The parameterization of the effective area to be used.

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.

energy_dispersion_maker_name

The parameterization of the energy dispersion to be used.

examples

flags

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>.

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.

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.

spatial_selection_applied

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.

description: str | Unicode[str, str | bytes] = 'Tool to create IRF files in GADF format'#
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.

name: str | Unicode[str, str | bytes] = 'ctapipe-compute-irf'#
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.

finish()[source]#

Write the irf (and the benchmarks) to the (respective) output file(s).

setup()[source]#

Initialize components from config and load g/h (and theta) cuts.

start()[source]#

Load events and calculate the irf (and the benchmarks).