def create_table_pedestal(hfile, cam_tel_group, nbGain, nbPixel, telId): """ Create the pedestal description of the telescope Parameters: hfile : HDF5 file to be used cam_tel_group : camera node to be used nbGain : number of gain of the camera nbPixel : number of pixel of the camera telId : id of the telescope Return: table of the pedestal of the telescope """ ped_shape = (nbGain, nbPixel) columns_dict_pedestal = { "first_event_id": tables.UInt64Col(), "last_event_id": tables.UInt64Col(), "pedestal": tables.Float32Col(shape=ped_shape) } description_pedestal = type('description columns_dict_pedestal', (tables.IsDescription, ), columns_dict_pedestal) table_pedestal = hfile.create_table( cam_tel_group, 'tel_{0:0=3d}'.format(telId), description_pedestal, "Table of the pedestal for high and low gain", expectedrows=1, chunkshape=1) return table_pedestal
class ExactMovieInfo(PT.IsDescription): cam_id = PT.StringCol(16, pos=0) filename = PT.StringCol(255, pos=1) start_frame = PT.UInt64Col(pos=2) stop_frame = PT.UInt64Col(pos=3) start_timestamp = PT.FloatCol(pos=4) stop_timestamp = PT.FloatCol(pos=5)
def createInjunctionTabTable(hfile, cam_tel_group, nameTable, nbPixel, chunkshape=1): ''' Create the table to store the signal Parameters: hfile : HDF5 file to be used cam_tel_group : telescope group in which to put the tables nameTable : name of the table to store the injunction tables nbPixel : number of pixels of the camera chunkshape : shape of the chunk to be used to store the data of waveform and minimum Return: Created table ''' columns_dict_tabInj = { "first_event_id": tables.UInt64Col(), "last_event_id": tables.UInt64Col(), "tabinj": tables.UInt16Col(shape=nbPixel) } description_tabInj = type('description columns_dict_tabInj', (tables.IsDescription, ), columns_dict_tabInj) return hfile.create_table(cam_tel_group, nameTable, description_tabInj, "Injunction tables of the signal", chunkshape=chunkshape)
class SubarrayLayout(tables.IsDescription): """ Layout of the subarray Attributes: tel_id : id of the telescope pos_x : position of the telescope on the X axix (in meters to the north) pos_y : position of the telescope on the Y axix (in meters to the west) pos_z : high of the telescope in meters name : name of the telescope type : type of the telescope type_id : type of the telscope in unsigned long (to speed up the access for specific analysis) num_mirrors : number of mirror of the telescope camera_type : type of the telescope camera tel_description : description of the telescope """ tel_id = tables.UInt64Col() pos_x = tables.Float32Col() pos_y = tables.Float32Col() pos_z = tables.Float32Col() name = tables.StringCol(5, dflt=b'') type = tables.StringCol(3, dflt=b'') type_id = tables.UInt64Col() num_mirrors = tables.UInt64Col() camera_type = tables.StringCol(9, dflt=b'') tel_description = tables.StringCol(14, dflt=b'')
class MCExtentInfo(tb.IsDescription): """Store the last row of each table as metadata using Pytables. """ evt_number = tb.Int32Col(pos=0) last_hit = tb.UInt64Col(pos=1) last_particle = tb.UInt64Col(pos=2)
class Data2DCameraSummary(PT.IsDescription): cam_id = PT.StringCol(16, pos=0) camn = PT.Int32Col(pos=1) start_frame = PT.UInt64Col(pos=2) stop_frame = PT.UInt64Col(pos=3) start_timestamp = PT.FloatCol(pos=4) stop_timestamp = PT.FloatCol(pos=5)
class FuncEntry(tables.IsDescription): fname = tables.StringCol(40) # name of function pc is located startaddr = tables.UInt64Col() # first address in relocation block startaddrlo = tables.UInt32Col() # first address in relocation block startaddrhi = tables.UInt32Col() # first address in relocation block endaddr = tables.UInt64Col() # first address in relocation block endaddrlo = tables.UInt32Col() # first address in relocation block endaddrhi = tables.UInt32Col() # first address in relocation block
class H5Record(tb.IsDescription): datetime = tb.UInt64Col() #IGNORE:E1101 open = tb.UInt32Col() #IGNORE:E1101 high = tb.UInt32Col() #IGNORE:E1101 low = tb.UInt32Col() #IGNORE:E1101 close = tb.UInt32Col() #IGNORE:E1101 vol = tb.UInt64Col() #IGNORE:E1101 amount = tb.UInt64Col() #IGNORE:E1101
class SubstageWriteIntervals(tables.IsDescription): substagenum = tables.UInt8Col() minaddr = tables.UInt64Col() minaddrlo = tables.UInt32Col() minaddrhi = tables.UInt32Col() maxaddr = tables.UInt64Col() maxaddrlo = tables.UInt32Col() maxaddrhi = tables.UInt32Col()
class H5Record(tb.IsDescription): datetime = tb.UInt64Col() #IGNORE:E1101 openPrice = tb.UInt32Col() #IGNORE:E1101 highPrice = tb.UInt32Col() #IGNORE:E1101 lowPrice = tb.UInt32Col() #IGNORE:E1101 closePrice = tb.UInt32Col() #IGNORE:E1101 transAmount = tb.UInt64Col() #IGNORE:E1101 transCount = tb.UInt64Col() #IGNORE:E1101
class EventSubarrayTrigger(tables.IsDescription): """ Create the r0 event subarray trigger table """ obs_id = tables.UInt64Col() event_id = tables.UInt64Col() time = tables.Float64Col() event_type = tables.UInt64Col()
class MemoryRegionAddrs(tables.IsDescription): short_name = tables.StringCol(255) startaddr = tables.UInt64Col() startaddrlo = tables.UInt32Col() startaddrhi = tables.UInt32Col() endaddr = tables.UInt64Col() endaddrlo = tables.UInt32Col() endaddrhi = tables.UInt32Col()
class FiveMinDataRecordH5File(tables.IsDescription): datetime = tables.UInt64Col() #IGNORE:E1101 openPrice = tables.UInt32Col() #IGNORE:E1101 highPrice = tables.UInt32Col() #IGNORE:E1101 lowPrice = tables.UInt32Col() #IGNORE:E1101 closePrice = tables.UInt32Col() #IGNORE:E1101 transAmount = tables.UInt64Col() #IGNORE:E1101 transCount = tables.UInt64Col() #IGNORE:E1101
class HisparcEvent(tables.IsDescription): event_id = tables.UInt64Col() timestamp = tables.Time32Col() nanoseconds = tables.UInt32Col() ext_timestamp = tables.UInt64Col() pulseheights = tables.Int16Col(shape=4, dflt=-9999) integrals = tables.Int32Col(shape=4, dflt=-9999) n_peaks = tables.Int32Col(shape=4, dflt=-9999) traces = tables.Int32Col(shape=4, dflt=-1)
class Region(tables.IsDescription): file_key = tables.UInt32Col( pos=0) chromosome = tables.StringCol(nps.chromosome_name_length, pos=1) region_name = tables.StringCol(64, pos=2) start = tables.UInt64Col( pos=3) stop = tables.UInt64Col( pos=4) strand = tables.StringCol(1, pos=5) count = tables.UInt64Col( pos=6) normalized_count = tables.Float64Col( pos=7)
class H5Record(tb.IsDescription): """HDF5基础K线数据格式(日线、分钟线、5分钟线""" datetime = tb.UInt64Col() #IGNORE:E1101 openPrice = tb.UInt32Col() #IGNORE:E1101 highPrice = tb.UInt32Col() #IGNORE:E1101 lowPrice = tb.UInt32Col() #IGNORE:E1101 closePrice = tb.UInt32Col() #IGNORE:E1101 transAmount = tb.UInt64Col() #IGNORE:E1101 transCount = tb.UInt64Col() #IGNORE:E1101
class MapInfo(tb.IsDescription): x_nbins = tb.UInt64Col(pos=0) y_nbins = tb.UInt64Col(pos=1) x_pitch = tb.Float64Col(pos=2) y_pitch = tb.Float64Col(pos=3) x_min = tb.Float64Col(pos=4) x_max = tb.Float64Col(pos=5) y_min = tb.Float64Col(pos=6) y_max = tb.Float64Col(pos=7)
class MemMapEntry(tables.IsDescription): name = tables.StringCol(512) startaddr = tables.UInt64Col() startaddrlo = tables.UInt32Col() startaddrhi = tables.UInt32Col() endaddr = tables.UInt64Col() endaddrlo = tables.UInt32Col() endaddrhi = tables.UInt32Col() perms = tables.EnumCol(perms, '?', base='uint8') kind = tables.EnumCol(mmap_type, 'other', base='uint8')
class SkipEntry(tables.IsDescription): pc = tables.UInt64Col() pclo = tables.UInt32Col() pchi = tables.UInt32Col() disasm = tables.StringCol(256) thumb = tables.BoolCol() resumepc = tables.UInt64Col() resumepclo = tables.UInt32Col() resumepchi = tables.UInt32Col() isfunction = tables.BoolCol()
class TraceWriteRange(tables.IsDescription): index = tables.UInt32Col() destlo = tables.UInt64Col() destlo = tables.UInt32Col() destlolo = tables.UInt32Col() destlohi = tables.UInt32Col() desthi = tables.UInt64Col() desthilo = tables.UInt32Col() desthihi = tables.UInt32Col() pc = tables.UInt64Col() pclo = tables.UInt32Col() pchi = tables.UInt32Col() relocatedpc = tables.UInt64Col() relocatedpclo = tables.UInt32Col() relocatedpchi = tables.UInt32Col() lr = tables.UInt64Col() lrlo = tables.UInt32Col() lrhi = tables.UInt32Col() relocatedlr = tables.UInt64Col() relocatedlrlo = tables.UInt32Col() relocatedlrhi = tables.UInt32Col() byteswritten = tables.UInt64Col() numops = tables.UInt64Col() cpsr = tables.UInt64Col() caller = tables.StringCol(40) substage = tables.UInt8Col()
class VarEntry(tables.IsDescription): name = tables.StringCol(512) startaddr = tables.UInt64Col() startaddrlo = tables.UInt32Col() startaddrhi = tables.UInt32Col() endaddr = tables.UInt64Col() endaddrlo = tables.UInt32Col() endaddrhi = tables.UInt32Col() substage = tables.Int16Col() kind = tables.EnumCol(var_type, 'othervar', base='uint8') perms = tables.EnumCol(var_perms, 'rw', base='uint8') rawkind = tables.StringCol(128)
class RegEntry(tables.IsDescription): name = tables.StringCol(512) address = tables.UInt64Col() addresslo = tables.UInt32Col() addresshi = tables.UInt32Col() width = tables.UInt8Col() reset = tables.StringCol(16) typ = tables.StringCol(16) offset = tables.UInt64Col() offsetlo = tables.UInt32Col() offsethi = tables.UInt32Col() table = tables.StringCol(256)
class EventTable(tables.IsDescription): event_index = tables.UInt64Col() event_id = tables.UInt64Col() telescope_id = tables.UInt8Col() n_photoelectrons = tables.UInt64Col() energy = tables.Float64Col() alt = tables.Float64Col() az = tables.Float64Col() core_x = tables.Float64Col() core_y = tables.Float64Col() h_first_int = tables.Float64Col() x_max = tables.Float64Col() shower_primary_id = tables.UInt8Col()
class ExportDescription(tables.IsDescription): id = tables.UInt64Col() label = tables.StringCol(16) name = tables.StringCol(128) time = tables.UInt64Col() mean = tables.Float64Col() std = tables.Float64Col() sig = tables.Float64Col() class BacktraceDescription(tables.IsDescription): filename = tables.StringCol(1024) line = tables.StringCol(1024) lineno = tables.IntCol() name = tables.StringCol(128)
class TriggerInfo(tables.IsDescription): """ Describe the trigger informations of the telescopes events Attributes: ----------- event_id : id of the corresponding event time_s : time of the event in second since 1st january 1970 time_qns : time in nanosecond (or picosecond) to complete the time in second obs_id : id of the observation """ event_id = tables.UInt64Col() time_s = tables.UInt32Col() time_qns = tables.UInt32Col() obs_id = tables.UInt64Col()
def _create_lightning_table(file, group): """Create lightning table in PyTables file Create an lightning table containing the ESD data columns which are available in the TSV download. :param file: PyTables file. :param group: the group to contain the lightning table, which need not exist. """ description = { 'event_id': tables.UInt32Col(pos=0), 'timestamp': tables.Time32Col(pos=1), 'nanoseconds': tables.UInt32Col(pos=2), 'ext_timestamp': tables.UInt64Col(pos=3), 'latitude': tables.Float32Col(pos=4), 'longitude': tables.Float32Col(pos=5), 'current': tables.Float32Col(pos=6) } return file.create_table(group, 'lightning', description, createparents=True)
def _create_events_table(file, group): """Create event table in PyTables file Create an event table containing the ESD data columns which are available in the TSV download. :param file: PyTables file. :param group: the group to contain the events table, which need not exist. """ description = { 'event_id': tables.UInt32Col(pos=0), 'timestamp': tables.Time32Col(pos=1), 'nanoseconds': tables.UInt32Col(pos=2), 'ext_timestamp': tables.UInt64Col(pos=3), 'pulseheights': tables.Int16Col(pos=4, shape=4), 'integrals': tables.Int32Col(pos=5, shape=4), 'n1': tables.Float32Col(pos=6), 'n2': tables.Float32Col(pos=7), 'n3': tables.Float32Col(pos=8), 'n4': tables.Float32Col(pos=9), 't1': tables.Float32Col(pos=10), 't2': tables.Float32Col(pos=11), 't3': tables.Float32Col(pos=12), 't4': tables.Float32Col(pos=13), 't_trigger': tables.Float32Col(pos=14) } return file.create_table(group, 'events', description, createparents=True)
class ShowerDistribution(tables.IsDescription): """ Distribution of the simulated events Attributes: bins_core_dist : distribution of the impact parameters by respect to the dstance by the center of the site bins_energy : distribution of the energy of the simulated events hist_id : id of the histogram num_entries : number of entries of the histogram obs_id : observation id """ bins_core_dist = tables.Float32Col(shape=(201, )) bins_energy = tables.Float32Col(shape=(121, )) hist_id = tables.UInt64Col() histogram = tables.Float32Col(shape=(120, 200)) num_entries = tables.UInt64Col() obs_id = tables.UInt64Col()
class ReconstructedCoincidence(tables.IsDescription): """Store information about reconstructed coincidences""" id = tables.UInt32Col(pos=1) ext_timestamp = tables.UInt64Col(pos=2) min_n = tables.Float32Col(pos=3) x = tables.Float32Col(pos=4) y = tables.Float32Col(pos=5) zenith = tables.Float32Col(pos=6) azimuth = tables.Float32Col(pos=7) size = tables.Float32Col(pos=8) energy = tables.Float32Col(pos=9) error_x = tables.Float32Col(pos=10) error_y = tables.Float32Col(pos=11) error_zenith = tables.Float32Col(pos=12) error_azimuth = tables.Float32Col(pos=13) error_size = tables.Float32Col(pos=14) error_energy = tables.Float32Col(pos=15) reference_x = tables.Float32Col(pos=16) reference_y = tables.Float32Col(pos=17) reference_zenith = tables.Float32Col(pos=18) reference_azimuth = tables.Float32Col(pos=19) reference_size = tables.Float32Col(pos=20) reference_energy = tables.Float32Col(pos=21)
class TimeDelta(tables.IsDescription): """Store time differences""" ext_timestamp = tables.UInt64Col(pos=0) timestamp = tables.UInt32Col(pos=1) nanoseconds = tables.UInt32Col(pos=2) delta = tables.FloatCol(pos=3)