DL1EventSource

class ctapipe.io.dl1eventsource.DL1EventSource(input_url=traitlets.Undefined, config=None, parent=None, **kwargs)[source]

Bases: ctapipe.io.eventsource.EventSource

Event source for files in the ctapipe DL1 format. For general information about the concept of event sources, take a look at the parent class ctapipe.io.EventSource.

To use this event source, create an instance of this class specifying the file to be read.

Looping over the EventSource yields events from the _generate_events method. An event equals an ArrayEventContainer instance. See ctapipe.containers.ArrayEventContainer for details.

Attributes
input_url: str

Path to the input event file.

file: tables.File

File object

obs_ids: list

Observation ids of te recorded runs. For unmerged files, this should only contain a single number.

subarray: ctapipe.instrument.SubarrayDescription

The subarray configuration of the recorded run.

datalevels: Tuple

One or both of ctapipe.io.datalevels.DataLevel.DL1_IMAGES and ctapipe.io.datalevels.DataLevel.DL1_PARAMETERS depending on the information present in the file.

is_simulation: Boolean

Whether the events are simulated or observed.

simulation_configs: Dict

Mapping of obs_id to ctapipe.containers.SimulationConfigContainer if the file contains simulated events.

has_simulated_dl1: Boolean

Whether the file contains simulated camera images and/or image parameters evaluated on these.

Attributes Summary

datalevels

The datalevels provided by this event source

has_simulated_dl1

True for files with telescope-wise event information in the simulation group

is_simulation

True for files with a simulation group at the root of the file.

obs_ids

The observation ids of the runs located in the file Unmerged files should only contain a single obs id.

simulation_config

Returns the simulation config.

subarray

Obtain the subarray from the EventSource

Methods Summary

close()

is_compatible(file_path)

Abstract method to be defined in child class.

Attributes Documentation

datalevels
has_simulated_dl1

True for files with telescope-wise event information in the simulation group

is_simulation

True for files with a simulation group at the root of the file.

obs_ids
simulation_config

Returns the simulation config. In case of a merged file, this will be a list of simulation configs.

subarray

Methods Documentation

close()[source]
static is_compatible(file_path)[source]

Abstract method to be defined in child class.

Perform a set of checks to see if the input file is compatible with this file event_source.

Parameters
file_pathstr

File path to the event file.

Returns
compatiblebool

True if file is compatible, False if it is incompatible