ctapipe is not stable yet, so expect large and rapid changes to structure and functionality as we explore various design choices before the 1.0 release.

SimTelEventSource#

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

Bases: EventSource

Read events from a SimTelArray data file (in EventIO format).

ctapipe makes use of the sim_telarray metadata system to fill some information not directly accessible from the data inside the files itself. Make sure you set this parameters in the simulation configuration to fully make use of ctapipe. In future, ctapipe might require these metadata parameters.

This includes:

  • Reference Point of the telescope coordinates. Make sure to include the

    user-defined parameters LONGITUDE and LATITUDE with the geodetic coordinates of the array reference point. Also make sure the ALTITUDE config parameter is included in the global metadata.

  • Names of the optical structures and the cameras are read from

    OPTICS_CONFIG_NAME and CAMERA_CONFIG_NAME, make sure to include these in the telescope meta.

  • The MIRROR_CLASS should also be included in the telescope meta

    to correctly setup coordinate transforms.

If these parameters are not included in the input data, ctapipe will fallback guesses these based on available data and the list of known telescopes for ctapipe.instrument.guess_telescope.

Attributes Summary

atmosphere_density_profile

atmosphere density profile that can be integrated to convert between h_max and X_max.

atmosphere_profile_choice

Which type of atmosphere density profile to load from the file, in case more than one exists.

back_seekable

Require the event source to be backwards seekable.

calib_scale

Factor to transform ADC counts into number of photoelectrons.

calib_shift

Factor to shift the R1 photoelectron samples.

datalevels

The datalevels provided by this event source

focal_length_choice

If both nominal and effective focal lengths are available in the SimTelArray file, which one to use for the CameraFrame attached to the CameraGeometry instances in the SubarrayDescription, which will be used in CameraFrame to TelescopeFrame coordinate transforms.

gain_selector_type

.

is_simulation

Whether the currently opened file is simulated

is_stream

Bool indicating if input is a stream.

observation_blocks

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

override_obs_id

Use the given obs_id instead of the run number from sim_telarray

scheduling_blocks

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

select_gain

Whether to perform gain selection.

simulation_config

The simulation configurations of all observations provided by the EventSource, or None if the source does not provide simulated data

skip_calibration_events

Skip calibration events

subarray

Obtain the subarray from the EventSource

Methods Summary

close()

Close this event source.

is_compatible(file_path)

Abstract method to be defined in child class.

prepare_subarray_info(...)

Constructs a SubarrayDescription object from the telescope_descriptions given by SimTelFile

Attributes Documentation

atmosphere_density_profile#
atmosphere_profile_choice#

Which type of atmosphere density profile to load from the file, in case more than one exists. If set to AUTO, TABLE will be attempted first and if missing, FIVELAYER will be loaded.

back_seekable#

Require the event source to be backwards seekable. This will reduce in slower read speed for gzipped files and is not possible for zstd compressed files

calib_scale#

Factor to transform ADC counts into number of photoelectrons. Corrects the DC_to_PHE factor.

calib_shift#

Factor to shift the R1 photoelectron samples. Can be used to simulate mis-calibration.

datalevels#
focal_length_choice#

If both nominal and effective focal lengths are available in the SimTelArray file, which one to use for the CameraFrame attached to the CameraGeometry instances in the SubarrayDescription, which will be used in CameraFrame to TelescopeFrame coordinate transforms. The ‘nominal’ focal length is the one used during the simulation, the ‘effective’ focal length is computed using specialized ray-tracing from a point light source

gain_selector_type#

. Possible values: []

is_simulation#
is_stream#
observation_blocks#

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

override_obs_id#

Use the given obs_id instead of the run number from sim_telarray

scheduling_blocks#

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

select_gain#

Whether to perform gain selection. The default (None) means only select gain of physics events, not of calibration events.

simulation_config#
skip_calibration_events#

Skip calibration events

subarray#

Methods Documentation

close()[source]#

Close this event source.

No-op by default. Should be overridden by sources needing a cleanup-step

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

prepare_subarray_info(telescope_descriptions, header)[source]#

Constructs a SubarrayDescription object from the telescope_descriptions given by SimTelFile

Parameters:
telescope_descriptions: dict

telescope descriptions as given by SimTelFile.telescope_descriptions

header: dict

header as returned by SimTelFile.header

Returns:
SubarrayDescription

instrumental information