Low-level storage constructs

PyTables table descriptions for data storage

This module contains the table descriptions used by the detector simulation to store intermediate and final data in a HDF5 file.

class sapphire.storage.EventObservables

Store information about the observables of an event.

The observables are described for each station independently. So, for each event (with a unique id), there is a table row for each station (with a unique station_id), such that only the (id, station_id) combinations are unique in the table.

id

a unique identifier for the simulated event (only unique in this table)

station_id

station identifier, such that you can do:

>>> station = cluster.stations[station_id]
r, phi, x, y

coordinates of the station. Depending on the simulation, this might be constant throughout the simulation, or it might change event by event.

alpha

rotation of the station around its center

N

number of detectors with at least one particle

columns = {'phi': Float32Col(shape=(), dflt=0.0, pos=None), 'timestamp': Time32Col(shape=(), dflt=0, pos=None), 'nanoseconds': UInt32Col(shape=(), dflt=0, pos=None), 'n1': Float32Col(shape=(), dflt=0.0, pos=None), 't2': Float32Col(shape=(), dflt=0.0, pos=None), 't3': Float32Col(shape=(), dflt=0.0, pos=None), 'station_id': UInt8Col(shape=(), dflt=0, pos=None), 't1': Float32Col(shape=(), dflt=0.0, pos=None), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=None), 'N': UInt8Col(shape=(), dflt=0, pos=None), 'r': Float32Col(shape=(), dflt=0.0, pos=None), 't4': Float32Col(shape=(), dflt=0.0, pos=None), 'x': Float32Col(shape=(), dflt=0.0, pos=None), 'y': Float32Col(shape=(), dflt=0.0, pos=None), 'alpha': Float32Col(shape=(), dflt=0.0, pos=None), 'n2': Float32Col(shape=(), dflt=0.0, pos=None), 'n3': Float32Col(shape=(), dflt=0.0, pos=None), 'n4': Float32Col(shape=(), dflt=0.0, pos=None), 'id': UInt32Col(shape=(), dflt=0, pos=None)}
class sapphire.storage.Coincidence

Store information about a coincidence of stations within a cluster.

An extensive air shower can trigger multiple stations, resulting in a set of events which are from the same shower. This is called a coincidence.

This table assigns an id to a coincidence and provides some additional information. The events making up the coincidence can be looked up using the c_index table. Let coincidence be a row from this table, then you can do:

>>> coincidence_id = coincidence['id']
>>> event_ids = c_index[coincidence_id]
>>> coincidence_event_list = [events[u] for u in event_ids]

Note that all events included in the coincidence are not required to actually have measured particles. For example, simulations include all events from the same shower in the coincidence, regardless of observed particles. On the other hand, experimental datasets only include stations which have triggered, but may include events which have not actually measured the same shower, but simply measured other particles at the same time, by chance.

Simulations may set the x, y, zenith, azimuth, size, and energy attributes to simulation parameters, like core position and shower parameters.

id

a unique identifier for the coincidence (only unique in this table)

N

the number of triggered stations

x

The x coordinate of the shower core in a simulation.

y

The y coordinate of the shower core in a simulation.

zenith

The zenith direction of the (simulated) shower.

azimuth

The azimuth direction of the (simulated) shower.

size

The size (number of leptons) of the (simulated) shower.

energy

The primary particle energy of the (simulated) shower.

columns = {'zenith': Float32Col(shape=(), dflt=0.0, pos=7), 'timestamp': Time32Col(shape=(), dflt=0, pos=1), 'nanoseconds': UInt32Col(shape=(), dflt=0, pos=2), 'id': UInt32Col(shape=(), dflt=0, pos=0), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=3), 'azimuth': Float32Col(shape=(), dflt=0.0, pos=8), 'y': Float32Col(shape=(), dflt=0.0, pos=6), 'x': Float32Col(shape=(), dflt=0.0, pos=5), 'N': UInt8Col(shape=(), dflt=0, pos=4), 'energy': Float32Col(shape=(), dflt=0.0, pos=10), 'size': Float32Col(shape=(), dflt=0.0, pos=9)}
class sapphire.storage.TimeDelta

Store time differences

columns = {'timestamp': UInt32Col(shape=(), dflt=0, pos=1), 'nanoseconds': UInt32Col(shape=(), dflt=0, pos=2), 'delta': Float64Col(shape=(), dflt=0.0, pos=3), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=0)}
class sapphire.storage.ReconstructedCoincidence

Store information about reconstructed coincidences

columns = {'x': Float32Col(shape=(), dflt=0.0, pos=4), 'reference_zenith': Float32Col(shape=(), dflt=0.0, pos=18), 'error_x': Float32Col(shape=(), dflt=0.0, pos=10), 'error_y': Float32Col(shape=(), dflt=0.0, pos=11), 'zenith': Float32Col(shape=(), dflt=0.0, pos=6), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=2), 'energy': Float32Col(shape=(), dflt=0.0, pos=9), 'reference_azimuth': Float32Col(shape=(), dflt=0.0, pos=19), 'error_zenith': Float32Col(shape=(), dflt=0.0, pos=12), 'reference_x': Float32Col(shape=(), dflt=0.0, pos=16), 'error_energy': Float32Col(shape=(), dflt=0.0, pos=15), 'min_n': Float32Col(shape=(), dflt=0.0, pos=3), 'reference_size': Float32Col(shape=(), dflt=0.0, pos=20), 'error_size': Float32Col(shape=(), dflt=0.0, pos=14), 'azimuth': Float32Col(shape=(), dflt=0.0, pos=7), 'error_azimuth': Float32Col(shape=(), dflt=0.0, pos=13), 'reference_y': Float32Col(shape=(), dflt=0.0, pos=17), 'reference_energy': Float32Col(shape=(), dflt=0.0, pos=21), 'id': UInt32Col(shape=(), dflt=0, pos=1), 'y': Float32Col(shape=(), dflt=0.0, pos=5), 'size': Float32Col(shape=(), dflt=0.0, pos=8)}
class sapphire.storage.ReconstructedEvent

Store information about reconstructed events

id

Index referring to the id of the event that was reconstructed.

d1,d2,d3,d4

Booleans indicating which detectors participated in the reconstruction.

columns = {'zenith': Float32Col(shape=(), dflt=0.0, pos=6), 'd1': BoolCol(shape=(), dflt=False, pos=22), 'energy': Float32Col(shape=(), dflt=0.0, pos=9), 'error_zenith': Float32Col(shape=(), dflt=0.0, pos=12), 'error_energy': Float32Col(shape=(), dflt=0.0, pos=15), 'error_azimuth': Float32Col(shape=(), dflt=0.0, pos=13), 'reference_size': Float32Col(shape=(), dflt=0.0, pos=20), 'reference_y': Float32Col(shape=(), dflt=0.0, pos=17), 'd4': BoolCol(shape=(), dflt=False, pos=25), 'd2': BoolCol(shape=(), dflt=False, pos=23), 'id': UInt32Col(shape=(), dflt=0, pos=1), 'reference_x': Float32Col(shape=(), dflt=0.0, pos=16), 'reference_zenith': Float32Col(shape=(), dflt=0.0, pos=18), 'error_x': Float32Col(shape=(), dflt=0.0, pos=10), 'error_y': Float32Col(shape=(), dflt=0.0, pos=11), 'reference_azimuth': Float32Col(shape=(), dflt=0.0, pos=19), 'd3': BoolCol(shape=(), dflt=False, pos=24), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=2), 'min_n': Float32Col(shape=(), dflt=0.0, pos=3), 'error_size': Float32Col(shape=(), dflt=0.0, pos=14), 'azimuth': Float32Col(shape=(), dflt=0.0, pos=7), 'y': Float32Col(shape=(), dflt=0.0, pos=5), 'x': Float32Col(shape=(), dflt=0.0, pos=4), 'reference_energy': Float32Col(shape=(), dflt=0.0, pos=21), 'size': Float32Col(shape=(), dflt=0.0, pos=8)}
class sapphire.storage.KascadeEvent

Store events from KASCADE

columns = {'dens_mu': Float64Col(shape=(4,), dflt=0.0, pos=12), 'zenith': Float64Col(shape=(), dflt=0.0, pos=7), 'run_id': Int32Col(shape=(), dflt=0, pos=0), 'event_id': Int64Col(shape=(), dflt=0, pos=1), 'timestamp': Time32Col(shape=(), dflt=0, pos=2), 'energy': Float64Col(shape=(), dflt=0.0, pos=5), 'Num_e': Float64Col(shape=(), dflt=0.0, pos=9), 'ext_timestamp': UInt64Col(shape=(), dflt=0, pos=4), 'dens_e': Float64Col(shape=(4,), dflt=0.0, pos=11), 'Num_mu': Float64Col(shape=(), dflt=0.0, pos=10), 'P200': Float64Col(shape=(), dflt=0.0, pos=13), 'azimuth': Float64Col(shape=(), dflt=0.0, pos=8), 'T200': Float64Col(shape=(), dflt=0.0, pos=14), 'nanoseconds': UInt32Col(shape=(), dflt=0, pos=3), 'core_pos': Float64Col(shape=(2,), dflt=0.0, pos=6)}
class sapphire.storage.ReconstructedKascadeEvent

Store information about reconstructed events

columns = {'k_dens_e': Float64Col(shape=(4,), dflt=0.0, pos=None), 'min_n134': Float32Col(shape=(), dflt=0.0, pos=None), 'id': UInt32Col(shape=(), dflt=0, pos=None), 'k_T200': Float64Col(shape=(), dflt=0.0, pos=None), 'k_Num_mu': Float64Col(shape=(), dflt=0.0, pos=None), 'k_core_pos': Float64Col(shape=(2,), dflt=0.0, pos=None), 'reconstructed_theta': Float32Col(shape=(), dflt=0.0, pos=None), 'phi': Float32Col(shape=(), dflt=0.0, pos=None), 'reconstructed_phi': Float32Col(shape=(), dflt=0.0, pos=None), 'k_energy': Float64Col(shape=(), dflt=0.0, pos=None), 'station_id': UInt8Col(shape=(), dflt=0, pos=None), 'k_dens_mu': Float64Col(shape=(4,), dflt=0.0, pos=None), 'alpha': Float32Col(shape=(), dflt=0.0, pos=None), 'reference_phi': Float32Col(shape=(), dflt=0.0, pos=None), 'reference_theta': Float32Col(shape=(), dflt=0.0, pos=None), 'k_P200': Float64Col(shape=(), dflt=0.0, pos=None), 't2': Float32Col(shape=(), dflt=0.0, pos=None), 't3': Float32Col(shape=(), dflt=0.0, pos=None), 't1': Float32Col(shape=(), dflt=0.0, pos=None), 'r': Float32Col(shape=(), dflt=0.0, pos=None), 'n1': Float32Col(shape=(), dflt=0.0, pos=None), 'n2': Float32Col(shape=(), dflt=0.0, pos=None), 'n3': Float32Col(shape=(), dflt=0.0, pos=None), 'n4': Float32Col(shape=(), dflt=0.0, pos=None), 't4': Float32Col(shape=(), dflt=0.0, pos=None), 'k_Num_e': Float64Col(shape=(), dflt=0.0, pos=None)}