class EventTable(tables.IsDescription): n_triggers = tables.Int64Col(shape=self.n_superpixels) true_charge = tables.Int64Col(shape=self.n_pixels) measured_charge = tables.Float64Col(shape=self.n_pixels) # Event metadata illumination = tables.Float64Col()
class Persons_Leaving_Id_R(t.IsDescription): tripid = t.Int32Col() houseid = t.Int64Col() personid = t.Int32Col() starttime = t.Int32Col() fromzone = t.Int32Col() tripcount = t.Int64Col()
class Education_Forecast_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int64Col() enroll_f = t.Int32Col() grade_disagg_f = t.Int32Col() educ_disagg_f = t.Int32Col() educ_in_yrs_f = t.Int32Col()
class Education_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int64Col() enroll = t.Int32Col() grade_disagg = t.Int32Col() educ_disagg = t.Int32Col() educ_in_yrs = t.Int32Col()
class Qdata(tables.IsDescription): event_id = tables.Int32Col() timestamp = tables.Int64Col() chargestamp = tables.Int64Col() channel = tables.Int32Col() hv = tables.Int32Col() threshold = tables.Int32Col()
class ReconData(tables.IsDescription): EventID = tables.Int64Col(pos=0) # EventNo # inner recon E_sph_in = tables.Float16Col(pos=1) # Energy x_sph_in = tables.Float16Col(pos=2) # x position y_sph_in = tables.Float16Col(pos=3) # y position z_sph_in = tables.Float16Col(pos=4) # z position t0_in = tables.Float16Col(pos=5) # time offset success_in = tables.Int64Col(pos=6) # recon failure Likelihood_in = tables.Float16Col(pos=7) # outer recon E_sph_out = tables.Float16Col(pos=8) # Energy x_sph_out = tables.Float16Col(pos=9) # x position y_sph_out = tables.Float16Col(pos=10) # y position z_sph_out = tables.Float16Col(pos=11) # z position t0_out = tables.Float16Col(pos=12) # time offset success_out = tables.Int64Col(pos=13) # recon failure Likelihood_out = tables.Float16Col(pos=14) # truth info x_truth = tables.Float16Col(pos=15) # x position y_truth = tables.Float16Col(pos=16) # y position z_truth = tables.Float16Col(pos=17) # z position E_truth = tables.Float16Col(pos=18) # z position # unfinished tau_d = tables.Float16Col(pos=18) # decay time constant
class GroundTruthData(tables.IsDescription): EventID = tables.Int64Col(pos=0) ChannelID = tables.Int64Col(pos=1) PETime = tables.Float64Col(pos=2) photonTime = tables.Float64Col(pos=3) PulseTime = tables.Float64Col(pos=4) dETime = tables.Float64Col(pos=5)
class Persons_Location_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int32Col() personuniqueid = t.Int32Col() time = t.Int32Col() location = t.Int32Col() lasttripcount = t.Int64Col()
class Occupancy_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int32Col() tripid = t.Int32Col() occupancy = t.Int32Col() dependentpersonid = t.Int64Col() tripcount = t.Int64Col()
class Volunteer(tables.IsDescription): idnumber = tables.Int64Col(pos=0) name = tables.StringCol(128, pos=1) remarqs = tables.StringCol(128, pos=2) # time_start = tables.Time32Col(pos=4, shape=MAX_DAYS) time_end = tables.Time32Col(pos=5, shape=MAX_DAYS) affected_tasks = tables.Int64Col(pos=3, shape=50, dflt=-1)
class Order2(Order): traded_price = tables.Float64Col() traded_max_price = tables.Float64Col() traded_min_price = tables.Float64Col() traded_weighted_price = tables.Float64Col() traded_quantity = tables.Int64Col() aggr_quantity = tables.Int64Col() trades = tables.Int64Col()
class Tick(tables.IsDescription): timestamp = tables.Int64Col(pos=0) last_price = tables.Float64Col(pos=1) qty = tables.Int64Col(pos=2) bid_price1 = tables.Float64Col(pos=3) bid_qty1 = tables.Int64Col(pos=4) ask_price1 = tables.Float64Col(pos=5) ask_qty1 = tables.Int64Col(pos=6)
class ReconData(tables.IsDescription): EventID = tables.Int64Col(pos=0) x = tables.Float16Col(pos=1) y = tables.Float16Col(pos=2) z = tables.Float16Col(pos=3) t0 = tables.Float16Col(pos=4) E = tables.Float16Col(pos=5) tau_d = tables.Float16Col(pos=6) success = tables.Int64Col(pos=7)
class ReconData(tables.IsDescription): EventID = tables.Int64Col(pos=0) # EventNo x = tables.Float16Col(pos=1) # x position y = tables.Float16Col(pos=2) # y position z = tables.Float16Col(pos=3) # z position t0 = tables.Float16Col(pos=4) # time offset E = tables.Float16Col(pos=5) # energy tau_d = tables.Float16Col(pos=6) # decay time constant success = tables.Int64Col(pos=7) # recon failure
def create_input_group(h5f, title="input data at transmitter", rolloff_dflt=np.nan, attrs={}, arrays=["symbols", "bits"], **kwargs): """ Create the table for saving the input symbols and bits Parameters ---------- h5f : string or h5filehandle The file to use, if a string create or open new file title: string, optional The title description of the group attrs: dict, optional attributes on the table arrays: list, optional name of arrays referenced in the table **kwargs: keyword arguments passed to create_table/array, it is highly recommended to set expectedrows Returns ------- h5f : h5filehandle Pytables handle to the hdf file """ try: gr = h5f.create_group("/", "input", title=title) except AttributeError: h5f = tb.open_file(h5f, "a") gr = h5f.create_group("/", "input", title=title) # if no shape for input syms or bits is given use scalar t_in = h5f.create_table(gr, "signal", { "id": tb.Int64Col(), "idx_symbols": tb.Int64Col(dflt=0), "idx_bits": tb.Int64Col(dflt=0), "rolloff": tb.Float64Col(dflt=rolloff_dflt) }, title="parameters of input signal", **kwargs) setattr(t_in.attrs, "arrays", arrays) arr_syms = h5f.create_mdvlarray(gr, "symbols", tb.ComplexAtom(itemsize=16, dflt=np.nan), title="sent symbols", **kwargs) arr_bits = h5f.create_mdvlarray(gr, "bits", tb.BoolAtom(), title="sent bits", **kwargs) for k, v in attrs: setattr(t_in.attrs, k, v) return h5f
class TSeries(tb.IsDescription): year = tb.Int64Col(pos=1) month = tb.Int64Col(pos=2) lon = tb.Float64Col(pos=3) lat = tb.Float64Col(pos=4) dh = tb.Float64Col(pos=5) dagc = tb.Float64Col(pos=6) std = tb.Float64Col(pos=7) mode = tb.Int64Col(pos=8)
class Schedule_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int32Col() activitytype = t.Int32Col() locationid = t.Int32Col() starttime = t.Int32Col() endtime = t.Int32Col() duration = t.Int32Col() dependentpersonid = t.Int64Col()
class ReconData(tables.IsDescription): EventID = tables.Int64Col(pos=0) # EventNo t0 = tables.Float16Col(pos=4) # time offset tau_d = tables.Float16Col(pos=6) # decay time constant x_sph = tables.Float16Col(pos=8) # x position y_sph = tables.Float16Col(pos=9) # y position z_sph = tables.Float16Col(pos=10) # z position l0_sph = tables.Float16Col(pos=11) # energy success_sph = tables.Int64Col(pos=12) # recon failure
class Persons_Arrived_Id_R(t.IsDescription): houseid = t.Int64Col() personid = t.Int32Col() actualarrivaltime = t.Int32Col() expectedarrivaltime = t.Int32Col() tripdependentpersonid = t.Int64Col() tozone = t.Int32Col() personuniqueid = t.Int64Col() tripcount = t.Int64Col()
class RegionDescription(t.IsDescription): """ Description of a genomic region for PyTables Table """ ix = t.Int32Col(pos=0) chromosome = t.StringCol(100, pos=1) start = t.Int64Col(pos=2) end = t.Int64Col(pos=3) strand = t.Int8Col(pos=4) _mask_ix = t.Int32Col(pos=5)
class Ev_and_PN(tables.IsDescription): model_name = tables.StringCol(100) date = tables.StringCol(20) number_of_points = tables.Int64Col() bandwidth = tables.Int64Col() dis_param = tables.Float64Col() eig_vals = tables.Float64Col(_number_of_points) PN = tables.Float64Col(_number_of_points)
class Trades(tables.IsDescription): time = tables.Int64Col() trader_id = tables.Int64Col() trade_id = tables.Int64Col() sequence_id = tables.Int64Col() side = tables.Int8Col() price = tables.Float64Col() quantity = tables.Int64Col() origin_id = tables.Int8Col() is_auction = tables.BoolCol() is_aggressor = tables.BoolCol()
class SourceDescriptor(tb.IsDescription): id = tb.Int64Col(pos=0) tile_id = tb.Int64Col(pos=1) order = tb.Int64Col(pos=2) ra_j = tb.FloatCol(pos=3) ra_k = tb.FloatCol(pos=4) ra_h = tb.FloatCol(pos=5) dec_h = tb.FloatCol(pos=6) dec_j = tb.FloatCol(pos=7) dec_k = tb.FloatCol(pos=8) obs_number = tb.Int64Col(pos=9)
class Bars(tables.IsDescription): session_date = tables.Int64Col() first_time = tables.Int64Col() last_time = tables.Int64Col() first_price = tables.Float64Col() last_price = tables.Float64Col() high_price = tables.Float64Col() low_price = tables.Float64Col() volume = tables.Int64Col() trade_nb = tables.Int64Col()
class CKG(tables.IsDescription): model_name = tables.StringCol(100) date = tables.StringCol(20) number_of_points = tables.Int64Col() bandwidth = tables.Int64Col() dis_param = tables.Float64Col() c = tables.Float64Col() k = tables.Float64Col() g = tables.ComplexCol(16) seed = tables.Int64Col()
class Schedule_Allocation_R1(t.IsDescription): scheduleid = t.Int64Col() houseid = t.Int64Col() personid = t.Int32Col() activitytype = t.Int32Col() locationid = t.Int32Col() starttime = t.Int32Col() endtime = t.Int32Col() duration = t.Int32Col() dependentpersonid = t.Int64Col() tripcount = t.Int64Col()
def create_meas_group(h5f, title="measurement data", description=None, attrs=MEAS_UNITS, arrays=["data"], **kwargs): """ Create the table for saving oscilloscope measurements Parameters ---------- h5f : string or h5filehandle The file to use, if a string create or open new file title: string, optional The title description of the group data_shape: int Number of modes/polarizations description: dict or tables.IsDescription (optional) If given use to create the table arrays: list, optional name of arrays referenced in the table attrs: dict, optional attributes on the table **kwargs: keyword arguments passed to create_table/array, it is highly recommended to set expectedrows Returns ------- h5f : h5filehandle Pytables handle to the hdf file """ try: gr_meas = h5f.create_group("/", "measurements", title=title) except AttributeError: h5f = tb.open_file(h5f, "a") gr_meas = h5f.create_group("/", "measurements", title=title) gr_osc = h5f.create_group(gr_meas, "oscilloscope", title="Data from Realtime oscilloscope") if description is None: description = { "id": tb.Int64Col(), "samplingrate": tb.Float64Col(), "idx_data": tb.Int64Col() } t_meas = h5f.create_table(gr_osc, "signal", description, "sampled signal", **kwargs) setattr(t_meas.attrs, "arrays", arrays) arr = h5f.create_mdvlarray(gr_osc, "data", tb.ComplexAtom(itemsize=16), **kwargs) for k, v in attrs.items(): setattr(t_meas.attrs, k, v) return h5f
class Trips_Final_R(t.IsDescription): tripid = t.Int64Col() houseid = t.Int64Col() personid = t.Int32Col() vehid = t.Int32Col() tripmode = t.Int32Col() fromzone = t.Int32Col() tozone = t.Int32Col() starttime = t.Int32Col() endtime = t.Int32Col() trippurpose = t.Int32Col()
def create_schema(fp_length: int) -> Any: class Particle(tb.IsDescription): pass columns = {} pos = 1 columns["fp_id"] = tb.Int64Col(pos=pos) for i in range(1, math.ceil(fp_length / 64) + 1): pos += 1 columns["f" + str(i)] = tb.UInt64Col(pos=pos) columns["popcnt"] = tb.Int64Col(pos=pos + 1) Particle.columns = columns return Particle
class Household_Forecast_Population_R(t.IsDescription): houseid = t.Int64Col() bldgsz = t.Int32Col() hht = t.Int32Col() hinc = t.Int32Col() noc = t.Int32Col() persons = t.Int32Col() unittype = t.Int32Col() vehicl = t.Int32Col() wif = t.Int32Col() yrmoved = t.Int32Col() old_houseid = t.Int64Col()