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 uniquestation_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 = {'N': UInt8Col(shape=(), dflt=np.uint8(0), pos=None), 'alpha': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=None), 'id': UInt32Col(shape=(), dflt=np.uint32(0), pos=None), 'n1': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n2': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n3': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n4': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'nanoseconds': UInt32Col(shape=(), dflt=np.uint32(0), pos=None), 'phi': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'r': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'station_id': UInt8Col(shape=(), dflt=np.uint8(0), pos=None), 't1': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't2': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't3': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't4': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'timestamp': Time32Col(shape=(), dflt=np.int32(0), pos=None), 'x': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'y': Float32Col(shape=(), dflt=np.float32(0.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 thec_index
table. Letcoincidence
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
, andenergy
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 = {'N': UInt8Col(shape=(), dflt=np.uint8(0), pos=4), 'azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=8), 'energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=10), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=3), 'id': UInt32Col(shape=(), dflt=np.uint32(0), pos=0), 'nanoseconds': UInt32Col(shape=(), dflt=np.uint32(0), pos=2), 'size': Float32Col(shape=(), dflt=np.float32(0.0), pos=9), 'timestamp': Time32Col(shape=(), dflt=np.int32(0), pos=1), 'x': Float32Col(shape=(), dflt=np.float32(0.0), pos=5), 'y': Float32Col(shape=(), dflt=np.float32(0.0), pos=6), 'zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=7)}¶
- class sapphire.storage.TimeDelta¶
Store time differences
- columns = {'delta': Float64Col(shape=(), dflt=np.float64(0.0), pos=3), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=0), 'nanoseconds': UInt32Col(shape=(), dflt=np.uint32(0), pos=2), 'timestamp': UInt32Col(shape=(), dflt=np.uint32(0), pos=1)}¶
- class sapphire.storage.ReconstructedCoincidence¶
Store information about reconstructed coincidences
- columns = {'azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=7), 'energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=9), 'error_azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=13), 'error_energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=15), 'error_size': Float32Col(shape=(), dflt=np.float32(0.0), pos=14), 'error_x': Float32Col(shape=(), dflt=np.float32(0.0), pos=10), 'error_y': Float32Col(shape=(), dflt=np.float32(0.0), pos=11), 'error_zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=12), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=2), 'id': UInt32Col(shape=(), dflt=np.uint32(0), pos=1), 'min_n': Float32Col(shape=(), dflt=np.float32(0.0), pos=3), 'reference_azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=19), 'reference_energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=21), 'reference_size': Float32Col(shape=(), dflt=np.float32(0.0), pos=20), 'reference_x': Float32Col(shape=(), dflt=np.float32(0.0), pos=16), 'reference_y': Float32Col(shape=(), dflt=np.float32(0.0), pos=17), 'reference_zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=18), 'size': Float32Col(shape=(), dflt=np.float32(0.0), pos=8), 'x': Float32Col(shape=(), dflt=np.float32(0.0), pos=4), 'y': Float32Col(shape=(), dflt=np.float32(0.0), pos=5), 'zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=6)}¶
- 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 = {'azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=7), 'd1': BoolCol(shape=(), dflt=np.False_, pos=22), 'd2': BoolCol(shape=(), dflt=np.False_, pos=23), 'd3': BoolCol(shape=(), dflt=np.False_, pos=24), 'd4': BoolCol(shape=(), dflt=np.False_, pos=25), 'energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=9), 'error_azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=13), 'error_energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=15), 'error_size': Float32Col(shape=(), dflt=np.float32(0.0), pos=14), 'error_x': Float32Col(shape=(), dflt=np.float32(0.0), pos=10), 'error_y': Float32Col(shape=(), dflt=np.float32(0.0), pos=11), 'error_zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=12), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=2), 'id': UInt32Col(shape=(), dflt=np.uint32(0), pos=1), 'min_n': Float32Col(shape=(), dflt=np.float32(0.0), pos=3), 'reference_azimuth': Float32Col(shape=(), dflt=np.float32(0.0), pos=19), 'reference_energy': Float32Col(shape=(), dflt=np.float32(0.0), pos=21), 'reference_size': Float32Col(shape=(), dflt=np.float32(0.0), pos=20), 'reference_x': Float32Col(shape=(), dflt=np.float32(0.0), pos=16), 'reference_y': Float32Col(shape=(), dflt=np.float32(0.0), pos=17), 'reference_zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=18), 'size': Float32Col(shape=(), dflt=np.float32(0.0), pos=8), 'x': Float32Col(shape=(), dflt=np.float32(0.0), pos=4), 'y': Float32Col(shape=(), dflt=np.float32(0.0), pos=5), 'zenith': Float32Col(shape=(), dflt=np.float32(0.0), pos=6)}¶
- class sapphire.storage.KascadeEvent¶
Store events from KASCADE
- columns = {'Num_e': Float64Col(shape=(), dflt=np.float64(0.0), pos=9), 'Num_mu': Float64Col(shape=(), dflt=np.float64(0.0), pos=10), 'P200': Float64Col(shape=(), dflt=np.float64(0.0), pos=13), 'T200': Float64Col(shape=(), dflt=np.float64(0.0), pos=14), 'azimuth': Float64Col(shape=(), dflt=np.float64(0.0), pos=8), 'core_pos': Float64Col(shape=(np.int64(2),), dflt=np.float64(0.0), pos=6), 'dens_e': Float64Col(shape=(np.int64(4),), dflt=np.float64(0.0), pos=11), 'dens_mu': Float64Col(shape=(np.int64(4),), dflt=np.float64(0.0), pos=12), 'energy': Float64Col(shape=(), dflt=np.float64(0.0), pos=5), 'event_id': Int64Col(shape=(), dflt=np.int64(0), pos=1), 'ext_timestamp': UInt64Col(shape=(), dflt=np.uint64(0), pos=4), 'nanoseconds': UInt32Col(shape=(), dflt=np.uint32(0), pos=3), 'run_id': Int32Col(shape=(), dflt=np.int32(0), pos=0), 'timestamp': Time32Col(shape=(), dflt=np.int32(0), pos=2), 'zenith': Float64Col(shape=(), dflt=np.float64(0.0), pos=7)}¶
- class sapphire.storage.ReconstructedKascadeEvent¶
Store information about reconstructed events
- columns = {'alpha': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'id': UInt32Col(shape=(), dflt=np.uint32(0), pos=None), 'k_Num_e': Float64Col(shape=(), dflt=np.float64(0.0), pos=None), 'k_Num_mu': Float64Col(shape=(), dflt=np.float64(0.0), pos=None), 'k_P200': Float64Col(shape=(), dflt=np.float64(0.0), pos=None), 'k_T200': Float64Col(shape=(), dflt=np.float64(0.0), pos=None), 'k_core_pos': Float64Col(shape=(np.int64(2),), dflt=np.float64(0.0), pos=None), 'k_dens_e': Float64Col(shape=(np.int64(4),), dflt=np.float64(0.0), pos=None), 'k_dens_mu': Float64Col(shape=(np.int64(4),), dflt=np.float64(0.0), pos=None), 'k_energy': Float64Col(shape=(), dflt=np.float64(0.0), pos=None), 'min_n134': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n1': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n2': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n3': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'n4': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'phi': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'r': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'reconstructed_phi': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'reconstructed_theta': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'reference_phi': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'reference_theta': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 'station_id': UInt8Col(shape=(), dflt=np.uint8(0), pos=None), 't1': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't2': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't3': Float32Col(shape=(), dflt=np.float32(0.0), pos=None), 't4': Float32Col(shape=(), dflt=np.float32(0.0), pos=None)}¶