Get signal and timing values from events

Get data from HiSPARC events

This module contains functions to derive data from HiSPARC events. Common tasks for data reconstruction are getting the particle density and shower arrival time in detectors or a station. These functions are aware of processed events (i.e. reconstructed number of MIPs, arrival times and trigger time) and stations.

sapphire.analysis.event_utils.station_density(event, detector_ids=None, station=None)

Get particle density in a station

Detectors with error values will be ignored.

Parameters:
  • event – Processed event row.
  • detector_ids – list of detectors ids to consider. If None, the detectors in the station object will be used.
  • stationsapphire.clusters.Station object.
Returns:

average density over the chosen detectors.

sapphire.analysis.event_utils.detector_densities(event, detector_ids=None, station=None)

Get particle density in station detectors

Parameters:
  • event – Processed event row.
  • detector_ids – list of detectors ids for which to get particle densities.
  • stationsapphire.clusters.Station object.
Returns:

density in each chosen detector.

sapphire.analysis.event_utils.detector_density(event, detector_id, station=None)

Get particle density in station detector

Parameters:
  • event – Processed event row.
  • detector_id – detector id for which to get particle density.
  • stationsapphire.clusters.Station object, used to determine the detector size.
Returns:

density in the chosen detector.

sapphire.analysis.event_utils.station_arrival_time(event, reference_ext_timestamp, detector_ids=None, offsets=[0.0, 0.0, 0.0, 0.0], station=None)

Get station arrival time, i.e. first detector hit

Arrival time of first detector hit in the station. The returned time is relative to reference_ext_timestamp, because floats do not have enough precision to represent large timestamps in nanoseconds.

Parameters:
  • event – Processed event row.
  • reference_ext_timestamp – reference extended timestamp (in ns). The returned station arrival time will be relative to this timestamp. Often best to use the timestamp of the first event in a coincidence.
  • detector_ids – list of detectors ids for which to consider.
  • offsets – list of detector time offsets.
  • stationsapphire.clusters.Station object, used to determine the number of detectors.
Returns:

shower arrival time of the station relative to the reference timestamp.

sapphire.analysis.event_utils.relative_detector_arrival_times(event, reference_ext_timestamp, detector_ids=None, offsets=[0.0, 0.0, 0.0, 0.0], station=None)

Get relative arrival times for all detectors

Parameters:
  • event – Processed event row.
  • reference_ext_timestamp – reference extended timestamp (in ns). The returned station arrival time will be relative to this timestamp. Often best to use the timestamp of the first event in a coincidence.
  • detector_ids – list of detectors ids for which to get arrival times.
  • offsets – list of detector time offsets.
  • stationsapphire.clusters.Station object, used to determine the number of detectors.
Returns:

list of shower arrival times relative to the given reference.

sapphire.analysis.event_utils.detector_arrival_times(event, detector_ids=None, offsets=[0.0, 0.0, 0.0, 0.0], station=None)

Get corrected arrival times for all detectors

Parameters:
  • event – Processed event row.
  • detector_ids – list of detectors ids for which to get arrival times.
  • offsets – list of detector time offsets.
  • stationsapphire.clusters.Station object, used to determine the number of detectors.
Returns:

list of shower arrival times relative to the start of the trace.

sapphire.analysis.event_utils.detector_arrival_time(event, detector_id, offsets=[0.0, 0.0, 0.0, 0.0])

Get corrected arrival time for a detector

Parameters:
  • event – Event row.
  • detector_id – detector id for which to get arrival times.
  • offsets – list of detector time offsets.
Returns:

arrival time corrected by the offset.

sapphire.analysis.event_utils.get_detector_ids(station=None, event=None)

Determine the detector ids based on the station object or event data

Returns a list of detectors that should be present.

Note: Event based determination might not work for simulated data, since it currently does not simulate pulseheights.

Parameters:
Returns:

list of detector_ids.