class TelTableRow(IsDescription): """Describe row format for telescope type table. Contains parameter information for each telescope type in the data. NOTE: Additional columns are added dynamically to some tables, see the github wiki page for the full table/data format descriptions. Attributes ---------- type : tables.StringCol Telescope type name (i.e. 'LST:LSTCam') optics : tables.StringCol Telescope optics type name (i.e. 'LST'). camera : tables.StringCol Telescope camera type name (i.e. 'LSTCam'). num_pixels: tables.UInt32Col Number of pixels in the telescope camera. pix_rotation: tables.Float32Col Rotation angle in deg. cam_rotation: tables.Float32Col Overall camera rotation in deg. """ type = StringCol(20) optics = StringCol(20) camera = StringCol(20) num_pixels = UInt32Col() pix_rotation = Float32Col() cam_rotation = Float32Col()
class Test_GrainData(IsDescription): """ Description class specifying structured storage for tests """ idnumber = Int32Col() # Signed 64-bit integer volume = Float32Col() # float center = Float32Col(shape=(3, )) # float
class Array(IsDescription): """Row descriptor class for Pytables array data table. Contains parameter information for each selected telescope in the data. Attributes ---------- tel_id : UInt8Col UInt8 placeholder type for the telescope id (in the array) tel_x : Float32Col Float32 placeholder type for the telescope position x coordinate relative to the center of the array. tel_y : Float32Col Float32 placeholder type for the telescope position y coordinate relative to the center of the array. tel_z : Float32Col Float32 placeholder type for the telescope position z coordinate (height) relative to the CORSIKA observatory altitude. tel_type : StringCol String placeholder type for the telescope type name (i.e. 'LST') run_array_direction: Float32Col(2) Float32 tuple placeholder type for the array pointing direction for a given run (az,alt) """ tel_id = UInt8Col() tel_x = Float32Col() tel_y = Float32Col() tel_z = Float32Col() tel_type = StringCol(8) run_array_direction = Float32Col(2)
class PowerScanTableDescription(IsDescription): """ """ power_requested = Float32Col() power_achieved = Float32Col() voltage = Float32Col()
class ArrayTableRow(IsDescription): """Describe row format for telescope array table. Contains parameter information for each telescope in the array. NOTE: Additional columns are added dynamically to some tables, see the github wiki page for the full table/data format descriptions. Attributes ---------- id : tables.UInt8Col Telescope id (unique). type : tables.StringCol Telescope type name (i.e. 'LST:LSTCam'). x : tables.Float32Col Telescope position x coordinate relative to the center of the array. y : tables.Float32Col Telescope position y coordinate relative to the center of the array. z : tables.Float32Col Telescope position z coordinate (height) relative to the CORSIKA observatory altitude. """ id = UInt16Col() type = StringCol(20) x = Float32Col() y = Float32Col() z = Float32Col()
class CameraScanTableDescription(IsDescription): """ """ setpoint = Float32Col() frame_path = StringCol(140) ravg = Float32Col() gavg = Float32Col() bavg = Float32Col()
class PowerMapTableDescription(IsDescription): """ """ row = Float32Col() col = Float32Col() x = Float32Col() y = Float32Col() power = Float32Col()
class StrokelitudeDataDescription(IsDescription): frame = UInt64Col(pos=0) trigger_timestamp = FloatCol(pos=1) # when the image trigger happened processing_timestamp = FloatCol(pos=2) # when the analysis was done left = Float32Col(pos=3) # angle, degrees right = Float32Col(pos=4) # angle, degrees left_antenna = Float32Col(pos=5) # angle, degrees right_antenna = Float32Col(pos=6) # angle, degrees head = Float32Col(pos=7) # angle, degrees
class EventTableRow(IsDescription): """Describe row format for event table. Contains event-level information, mostly from Monte Carlo simulation parameters. NOTE: Additional columns are added dynamically to some tables, see the github wiki page for the full table/data format descriptions. Attributes ---------- event_id : tables.UInt32Col Shower event id. obs_id : tables.UInt32Col Shower observation (run) id. Replaces old "run_id" in ctapipe r0 container. true_shower_primary_id : tables.UInt8Col Particle type id for the shower primary particle. From Monte Carlo simulation parameters. true_core_x : tables.Float32Col Shower core position x coordinate. From Monte Carlo simulation parameters. true_core_y : tables.Float32Col Shower core position y coordinate. From Monte Carlo simulation parameters. true_h_first_int : tables.Float32Col Height of shower primary particle first interaction. From Monte Carlo simulation parameters. true_energy : tables.Float32Col Energy of the shower primary particle in TeV. From Monte Carlo simulation parameters. log_true_energy : tables.Float32Col Energy of the shower primary particle in log(TeV). From Monte Carlo simulation parameters. true_az : tables.Float32Col Shower azimuth angle. From Monte Carlo simulation parameters. true_alt : tables.Float32Col Shower altitude (zenith) angle. From Monte Carlo simulation parameters. array_pointing_az : tables.Float32Col Array pointing azimuth angle. array_pointing_alt : tables.Float32Col Array pointing altitude (zenith) angle. """ event_id = UInt32Col() obs_id = UInt32Col() true_shower_primary_id = UInt8Col() true_core_x = Float32Col() true_core_y = Float32Col() true_h_first_int = Float32Col() true_x_max = Float32Col() true_energy = Float32Col() log_true_energy = Float32Col() true_az = Float32Col() true_alt = Float32Col() array_pointing_az = Float32Col() array_pointing_alt = Float32Col()
class SSelectorOnMeshElement(IsDescription): shortName = StringCol(ELEMENT_LENGTH, pos=0) imin = Int32Col(pos=1) jmin = Int32Col(pos=2) kmin = Int32Col(pos=3) imax = Int32Col(pos=4) jmax = Int32Col(pos=5) kmax = Int32Col(pos=6) v1 = Float32Col() v2 = Float32Col() v3 = Float32Col()
class ncdf_weather(IsDescription): day = Time32Col(pos=1) tmax = Float32Col(pos=2) tmin = Float32Col(pos=3) temp = Float32Col(pos=4) rain = Float32Col(pos=5) irrad = Float32Col(pos=6) wind = Float32Col(pos=7) vap = Float32Col(pos=8) e0 = Float32Col(pos=9) es0 = Float32Col(pos=10) et0 = Float32Col(pos=11);
class Preopen(IsDescription): symbol = StringCol(50) xDt = StringCol(50) caAct = StringCol(50) iep = Float32Col() chn = Float16Col() perChn = Float16Col() pCls = Float32Col() trdQnty = Int32Col() iVal = Float16Col() sumVal = Float32Col() sumQnty = Int32Col() finQnty = Int32Col() sumfinQnty = Int32Col()
class Derivative(IsDescription): INSTRUMENT = StringCol(6) SYMBOL = StringCol(50) EXPIRY_DT = StringCol(11) STRIKE_PR = Int32Col() OPTION_TYP = StringCol(2) OPEN = Float32Col() HIGH = Float32Col() LOW = Float32Col() CLOSE = Float32Col() SETTLE_PR = Float32Col() CONTRACTS = Int32Col() VAL_INLAKH = Float64Col() OPEN_INT = Int32Col() CHG_IN_OI = Int32Col() TIMESTAMP = StringCol(11)
class SSReadoutTableDs(IsDescription): iro = UInt64Col() # readout numner/index time = UInt64Col() # TACK timestamp cpu_t = Float64Col() # native python timestamp float64 cpu_t_s = UInt64Col() # seconds time stamp uint64 cpu_t_ns = UInt64Col() # nano seconds time stamp uint64 data = Float32Col((N_TM, N_TM_PIX)) # 2D data array containing
class Record(tables.IsDescription): var1 = StringCol(itemsize=4, dflt=b"abcd", pos=0) var2 = StringCol(itemsize=1, dflt=b"a", pos=1) var3 = BoolCol(dflt=1) var4 = Int8Col(dflt=1) var5 = UInt8Col(dflt=1) var6 = Int16Col(dflt=1) var7 = UInt16Col(dflt=1) var8 = Int32Col(dflt=1) var9 = UInt32Col(dflt=1) var10 = Int64Col(dflt=1) var11 = Float32Col(dflt=1.0) var12 = Float64Col(dflt=1.0) var13 = ComplexCol(itemsize=8, dflt=(1. + 0.j)) var14 = ComplexCol(itemsize=16, dflt=(1. + 0.j)) if hasattr(tables, 'Float16Col'): var15 = tables.Float16Col(dflt=1.0) if hasattr(tables, 'Float96Col'): var16 = tables.Float96Col(dflt=1.0) if hasattr(tables, 'Float128Col'): var17 = tables.Float128Col(dflt=1.0) if hasattr(tables, 'Complex196Col'): var18 = tables.ComplexCol(itemsize=24, dflt=(1. + 0.j)) if hasattr(tables, 'Complex256Col'): var19 = tables.ComplexCol(itemsize=32, dflt=(1. + 0.j))
class _VariantDescription(IsDescription): CHROM = StringCol(256) POS = Int32Col() ID = StringCol(256) REF = StringCol(256) ALT = StringCol(256) QUAL = Float32Col() CAF = StringCol(256) CLNDISDB = StringCol(256) CLNDN = StringCol(256) CLNSIG = StringCol(256) CLNREVSTAT = StringCol(256) CLNVI = StringCol(256) effect = StringCol(256) impact = StringCol(256) gene_name = StringCol(256) GT = StringCol(256)
class TwoGenomeWideAssociationLocusMapTable(tables.IsDescription): """ 2013.1.26 further attributes associated with this table: input1_fname, input2_fname, gw_association_locus1 (id, call-method, analysis-method-ls), gw_association_locus2 (id, cm, am) if "pos=.." is not added, they are sorted alphabetically by their names. """ id = UInt64Col(pos=0) #2013.2.24 overall position of the locus chromosome = StringCol(64, pos=1) #64 byte-long start = UInt64Col(pos=2) stop = UInt64Col(pos=3) input1_locus_id = UInt64Col(pos=4) input1_chromosome = StringCol(64, pos=5) input1_start = UInt64Col(pos=6) input1_stop = UInt64Col(pos=7) input2_locus_id = UInt64Col(pos=8) input2_chromosome = StringCol(64, pos=9) input2_start = UInt64Col(pos=10) input2_stop = UInt64Col(pos=11) locusOverlapFraction = Float64Col(pos=12) no_of_total_phenotypes = UInt32Col(pos=13) #all significant phenotypes total_phenotype_ls_in_str = StringCol(1000, pos=14) fraction_of_total_phenotypes = Float32Col( pos=15) #divided by all phenotypes with association no_of_overlap_phenotypes = UInt32Col(pos=16) overlap_phenotype_ls_in_str = StringCol(1000, pos=17) fraction_of_overlap_phenotypes = Float32Col( pos=18 ) #divided by the no_of_total_phenotypes (3 cols above, with significant hits) no_of_input1_only_phenotypes = UInt32Col(pos=19) input1_only_phenotype_ls_in_str = StringCol(1000, pos=20) fraction_of_input1_only_phenotypes = Float32Col(pos=21) no_of_input2_only_phenotypes = UInt32Col(pos=22) input2_only_phenotype_ls_in_str = StringCol(1000, pos=23) fraction_of_input2_only_phenotypes = Float32Col(pos=24)
class Particle(IsDescription): name = StringCol(16) # 16-character String idnumber = Int64Col() # Signed 64-bit integer ADCcount = UInt16Col() # Unsigned short integer TDCcount = UInt8Col() # unsigned byte grid_i = Int32Col() # 32-bit integer grid_j = Int32Col() # 32-bit integer pressure = Float32Col() # float (single-precision) energy = Float64Col() # double (double-precision)
def setup_peakmap_table(self): if not hasattr(self.node, "pm_table"): description = {} description["unique_id"] = StringCol(itemsize=64, pos=0) description["index"] = UInt32Col(pos=1) description["ms_levels"] = StringCol( itemsize=self.MSLEVEL_FIELD_SIZE, pos=2) description["rtmin"] = Float32Col(pos=3) description["rtmax"] = Float32Col(pos=4) description["mzmin"] = Float32Col(pos=5) description["mzmax"] = Float32Col(pos=6) pm_table = self.file_.create_table(self.node, 'pm_table', description, filters=filters) # every colums which appears in a where method call should/must be indexed ! # this is not only for performance but for correct lookup as well (I had strange bugs # else) pm_table.cols.unique_id.create_index() pm_table.cols.index.create_index()
def init_dynamic_scalars_and_fields(self, shape, scalars, fields): # create scalars tab self.dynamic_scalars = set(scalars) cols_desc = {c: Float64Col() for c in scalars} cols_desc['t'] = Float32Col() self.tab_dynamic_scalars = self.f.create_table(self.f.root, 'dynamic_scalars', cols_desc, 'Dynamic scalars') self.tab_dynamic_scalars.row.append() self.tab_dynamic_scalars.flush() # create fields tab self.dynamic_fields = set(fields) cols_desc = {f: Float64Col(shape) for f in fields} cols_desc['t'] = Float32Col() self.tab_dynamic_fields = self.f.create_table(self.f.root, 'dynamic_fields', cols_desc, 'Dynamic fields') # snapshot self.snapshot(t=0.0, **scalars, **fields)
def setup_spec_table(self): if not hasattr(self.node, "ms1_spec_table"): for level in (1, 2): description = {} description["pm_index"] = UInt32Col(pos=0) description["rt"] = Float32Col(pos=1) description["scan_number"] = Int32Col(pos=2) description["start"] = UInt64Col(pos=3) description["end"] = UInt64Col(pos=4) t = self.file_.create_table(self.node, 'ms%d_spec_table' % level, description, filters=filters) # every colums which appears in a where method call should/must be indexed ! # this is not only for performance but for correct lookup as well (I had strange bugs # else) t.cols.pm_index.create_index() t.cols.rt.create_index()
class StrokelitudeDataDescription(IsDescription): frame = UInt64Col(pos=0) trigger_timestamp = FloatCol(pos=1) # when the image trigger happened processing_timestamp = FloatCol(pos=2) # when the analysis was done left = Float32Col(pos=3) # angle, degrees right = Float32Col(pos=4) # angle, degrees left_antenna = Float32Col(pos=5) # angle, degrees right_antenna = Float32Col(pos=6) # angle, degrees head = Float32Col(pos=7) # angle, degrees pulse_width = Float32Col( pos=8) # random pulse width, 0 = short, 1 = long, 2 = unknown pulse_frame = UInt64Col(pos=9) # frame number associated with random pulse
def setup_spec_table(self): if not hasattr(self.node, "spec_table"): description = {} description["pm_index"] = UInt32Col(pos=0) description["rt"] = Float32Col(pos=1) description["ms_level"] = UInt8Col(pos=2) description["start"] = UInt64Col(pos=3) description["size"] = UInt32Col(pos=4) spec_table = self.file_.create_table(self.node, 'spec_table', description, filters=filters) # every colums which appears in a where method call should/must be indexed ! # this is not only for performance but for correct lookup as well (I had strange bugs # else) spec_table.cols.pm_index.create_index() spec_table.cols.rt.create_index()
class Tel(IsDescription): """Row descriptor class for Pytables telescope data table. Contains parameter information for each selected telescope in the data. Attributes ---------- tel_type : StringCol String placeholder type for the telescope type name (i.e. 'LST') num_pixels: UInt32Col UInt32 placeholder type for telescope's number of pixels pixel_pos: Float32Col Float32Col placeholder type for pixel's coordinates """ tel_type = StringCol(8) num_pixels = UInt32Col() pixel_pos = Float32Col(2)
class Equity(IsDescription): SYMBOL = StringCol(50) SERIES = StringCol(2) OPEN = Float32Col() HIGH = Float32Col() LOW = Float32Col() CLOSE = Float32Col() LAST = Float32Col() PREVCLOSE = Float32Col() TOTTRDQTY = Int32Col() TOTTRDVAL = Float64Col() TIMESTAMP = StringCol(12) TOTALTRADES = Int32Col() ISIN = StringCol(12)
class _VariantDescription(IsDescription): """ Describe VariantHDF5 table columns. """ # TODO: Optimize CHROM = StringCol(8) POS = Int32Col() ID = StringCol(16) REF = StringCol(256) ALT = StringCol(256) QUAL = Float32Col() # INFO CAF = StringCol(16) CLNSIG = StringCol(8) CLNDBN = StringCol(256) # INFO ANN effect = StringCol(32) impact = StringCol(32) gene_name = StringCol(32) # FORMAT & sample GT = StringCol(8)
class Event(IsDescription): """Row descriptor class for Pytables event table. Contains event-level parameters, mostly from Monte Carlo simulation parameters. Attributes ---------- event_number : UInt32Col UInt32 placeholder type for the shower event id run_number : UInt32Col UInt32 placeholder type for the run number particle_id : UInt8Col UInt8 placeholder type for the CORSIKA-simulated primary particle type code. core_x : Float64Col Float64 placeholder type for the Monte Carlo shower core position x coordinate. core_y : Float64Col Float64 placeholder type for the Monte Carlo shower core position y coordinate. h_first_int : Float64Col Float64 placeholder type for the Monte Carlo height of first interaction of the primary particle. mc_energy : Float64Col Float64 placeholder type for the Monte Carlo energy of the primary particle. az : Float32Col Float32 placeholder type for the shower azimuth angle. alt : Float32Col Float32 placeholder type for the shower altitude (zenith) angle """ event_number = UInt32Col() run_number = UInt32Col() particle_id = UInt8Col() core_x = Float32Col() core_y = Float32Col() h_first_int = Float32Col() mc_energy = Float32Col() az = Float32Col() alt = Float32Col()
class Record(tables.IsDescription): var1 = StringCol(itemsize=4) # 4-character String var2 = IntCol() # integer var3 = Int16Col() # short integer var4 = FloatCol() # double (double-precision) var5 = Float32Col() # float (single-precision)
class Jaszczak(IsDescription): jaszczak = Float32Col([256, 256]) radius = Float32Col(10) inten = Float32Col(10)
class description(IsDescription): time = Int32Col() st = Int8Col(shape=(N_CH, )) wave = Float32Col(shape=(S_TOTAL, N_CH)) fet = Float32Col(shape=(N_CH, FPC)) clu = Int32Col()