ctaoirf - IRF Management
IRFHouse
Section titled “IRFHouse”Manages and loads multiple CTA Instrument Response Functions (IRFs).
Constructor
Section titled “Constructor”IRFHouse(base_directory: str | Path, check_irfs: bool = False)Parameters:
| Parameter | Type | Description |
|---|---|---|
base_directory | str | Path | Root directory containing IRF files |
check_irfs | bool | If True, verify all IRF files exist during initialization |
Example:
from sensipy.ctaoirf import IRFHouse
house = IRFHouse(base_directory="./IRFs/CTAO")Methods
Section titled “Methods”get_irf()
Section titled “get_irf()”Load a specific IRF configuration.
get_irf( site: Site | str, configuration: Configuration | str, zenith: Zenith | int, duration: Duration | int, azimuth: Azimuth | str, version: Version | str,) -> IRFParameters:
| Parameter | Type | Options |
|---|---|---|
site | str | "north", "south" |
configuration | str | "alpha", "omega", "alpha_lst" |
zenith | int | 20, 40, 60 (degrees) |
duration | int | 1800, 18000, 180000 (seconds) |
azimuth | str | "north", "south", "average" |
version | str | "prod5-v0.1", "prod3b-v2" |
Returns: IRF object
Example:
irf = house.get_irf( site="south", configuration="alpha", zenith=20, duration=1800, azimuth="average", version="prod5-v0.1",)check_all_paths()
Section titled “check_all_paths()”Verify all expected IRF files exist.
check_all_paths() -> NonePrints status for all IRF combinations and reports missing files.
house.check_all_paths()Represents a single Instrument Response Function configuration.
Attributes
Section titled “Attributes”| Attribute | Type | Description |
|---|---|---|
filepath | Path | Path to IRF FITS file |
site | Site | Observatory site (north/south) |
configuration | Configuration | Telescope configuration |
zenith | Zenith | int | Zenith angle |
duration | Duration | int | IRF duration |
azimuth | Azimuth | Azimuth direction |
version | Version | IRF production version |
base_directory | Path | Base IRF directory |
Properties
Section titled “Properties”energy_limits
Section titled “energy_limits”Get energy range of the IRF.
energy_min, energy_max = irf.energy_limitsprint(f"Energy range: {energy_min} to {energy_max}")Methods
Section titled “Methods”__repr__()
Section titled “__repr__()”String representation of the IRF.
print(irf)# Output:# CTA IRF [prod5-v0.1]# filepath: .../CTA-Performance-prod5-v0.1-South-20deg...# config: alpha# site: south# zenith: 20º# duration: 1800s# azimuth: average__fspath__()
Section titled “__fspath__()”Return file path (allows IRF to be used as path-like object).
from gammapy.irf import load_irf_dict_from_file
irf_dict = load_irf_dict_from_file(irf) # Uses __fspath__()Enumerations
Section titled “Enumerations”class Site(str, Enum): south = "south" north = "north"Configuration
Section titled “Configuration”class Configuration(str, Enum): alpha = "alpha" omega = "omega" alpha_lst = "alpha_lst"Zenith
Section titled “Zenith”class Zenith(IntEnum): z20 = 20 z40 = 40 z60 = 60Duration
Section titled “Duration”class Duration(IntEnum): t1800 = 1800 t18000 = 18000 t180000 = 180000Azimuth
Section titled “Azimuth”class Azimuth(str, Enum): south = "south" north = "north" average = "average"Version
Section titled “Version”class Version(str, Enum): prod5_v0p1 = "prod5-v0.1" prod3b_v2 = "prod3b-v2"Using Enums
Section titled “Using Enums”from sensipy.ctaoirf import IRFHouse, Site, Zenith, Configuration
house = IRFHouse(base_directory="./IRFs/CTAO")
irf = house.get_irf( site=Site.south, configuration=Configuration.alpha, zenith=Zenith.z20, duration=1800, azimuth="average", version="prod5-v0.1",)