class SessionMetaData(tables.IsDescription): session_id = UInt32Col(pos=1) experiment_id = UInt32Col(pos=2) code = StringCol(24, pos=3) name = StringCol(48, pos=4) comments = StringCol(256, pos=5) user_variables = StringCol(2048, pos=6) # will hold json encoded version of user variable dict for session
def setup(self): self.x_blob = self.file_.create_earray(self.node, "ts_x_values", Atom.from_dtype(np.dtype("int64")), (0,), filters=filters) self.y_blob = self.file_.create_earray(self.node, "ts_y_values", Atom.from_dtype(np.dtype("float64")), (0,), filters=filters) self.bp = self.file_.create_earray(self.node, "bp", Atom.from_dtype(np.dtype("int32")), (0,), filters=filters) description = {} description["unique_id"] = StringCol(itemsize=64, pos=0) description["index"] = UInt32Col(pos=1) description["blank_flags_is_none"] = BoolCol(pos=2) description["label"] = StringCol(itemsize=32, pos=3) description["start"] = UInt32Col(pos=4) description["size"] = UInt32Col(pos=5) description["bp_start"] = UInt32Col(pos=6) description["bp_size"] = UInt32Col(pos=7) self.ts_index = self.file_.create_table(self.node, "ts_index", description, filters=None) # 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) self.ts_index.cols.unique_id.create_index() self.ts_index.cols.index.create_index()
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. shower_primary_id : tables.UInt8Col Particle type id for the shower primary particle. From Monte Carlo simulation parameters. core_x : tables.Float32Col Shower core position x coordinate. From Monte Carlo simulation parameters. core_y : tables.Float32Col Shower core position y coordinate. From Monte Carlo simulation parameters. h_first_int : tables.Float32Col Height of shower primary particle first interaction. From Monte Carlo simulation parameters. mc_energy : tables.Float32Col Energy of the shower primary particle in TeV. From Monte Carlo simulation parameters. log_mc_energy : tables.Float32Col Energy of the shower primary particle in log(TeV). From Monte Carlo simulation parameters. az : tables.Float32Col Shower azimuth angle. From Monte Carlo simulation parameters. 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. delta_direction : tables.Float32Col(2) Angular distance of the shower azimuth and the array pointing. """ event_id = UInt32Col() obs_id = UInt32Col() shower_primary_id = UInt8Col() core_x = Float32Col() core_y = Float32Col() h_first_int = Float32Col() x_max = Float32Col() mc_energy = Float32Col() log_mc_energy = Float32Col() az = Float32Col() alt = Float32Col() array_pointing_az = Float32Col() array_pointing_alt = Float32Col() delta_direction = Float32Col(2)
class Post(IsDescription): id = Int32Col() post_type_id = UInt8Col() parent_id = Int32Col() accepted_answer_id = Int32Col() creation_date = Time32Col() score = UInt32Col() viewcount = UInt32Col() owner_user_id = Int32Col() answer_count = UInt16Col() favorite_count = UInt16Col() tags = StringCol(itemsize=25, shape=(5, ))
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 ExperimentMetaData(tables.IsDescription): experiment_id = UInt32Col(pos=1) code = StringCol(24, pos=2) title = StringCol(48, pos=3) description = StringCol(256, pos=4) version = StringCol(6, pos=5) total_sessions_to_run = UInt16Col(pos=9)
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 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)
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 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()
def setup(self, node, block_size, blob_name, index_name): if not hasattr(node, blob_name): self.file_.create_earray(node, blob_name, StringAtom(itemsize=block_size), (0, ), filters=filters) description = {} description["index"] = Int64Col(pos=0) description["start"] = UInt32Col(pos=1) description["size"] = UInt32Col(pos=2) # 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) string_index = self.file_.create_table(node, index_name, description, filters=None) string_index.cols.index.create_index()
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 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)
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()
class _Links(IsDescription): source = UInt32Col() target = UInt32Col()
class _Nodes(IsDescription): seqid = UInt8Col() start = UInt32Col() stop = UInt32Col()
class ClassTableMappings(tables.IsDescription): class_id = UInt32Col(pos=1) class_type_id = UInt32Col(pos=2) # Device or Event etc. class_name = StringCol(32, pos=3) table_path = StringCol(128, pos=4)
class ExperimentMetaData(tables.IsDescription): experiment_id = UInt32Col(pos=1) code = StringCol(256, pos=2) title = StringCol(256, pos=3) description = StringCol(4096, pos=4) version = StringCol(32, pos=5)
class TimestampedZeoDesc(IsDescription): timestamp = UInt32Col() timestamp_subsec = Float32Col() version = UInt8Col()
class Photon(IsDescription): hits = Float32Col([len(template.hits), 4]) first_hit_index = UInt32Col() nb_true_hits = UInt32Col()
class Photon(IsDescription): hits = Float32Col([len(template.hits), 4]) crystal_index = UInt32Col([len(template.hits)])