SimTelEventSource

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

Bases: ctapipe.io.eventsource.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 avaible 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

scheduling_blocks

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

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

scheduling_blocks

Obtain the ObservationConfigurations from the EventSource, indexed by obs_id

simulation_config
skip_calibration_events

Skip calibration events

subarray

Methods Documentation

close()[source]

Close this event source.

No-op by default. Should be overriden 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