class Crossover(tb.IsDescription): sat = tb.StringCol(32, pos=1) region = tb.Int16Col(pos=2) lon = tb.Float64Col(pos=3) lat = tb.Float64Col(pos=4) time_1 = tb.StringCol(64, pos=5) time_2 = tb.StringCol(64, pos=6) year_1 = tb.Int16Col(pos=7) year_2 = tb.Int16Col(pos=8) month_1 = tb.Int16Col(pos=9) month_2 = tb.Int16Col(pos=10) season_1 = tb.StringCol(32, pos=11) season_2 = tb.StringCol(32, pos=12) orbit_1 = tb.Int32Col(pos=13) orbit_2 = tb.Int32Col(pos=14) utc85_1 = tb.Float64Col(pos=15) utc85_2 = tb.Float64Col(pos=16) elev_1 = tb.Float64Col(pos=17) elev_2 = tb.Float64Col(pos=18) agc_1 = tb.Float64Col(pos=19) agc_2 = tb.Float64Col(pos=20) fmode_1 = tb.Int8Col(pos=21) fmode_2 = tb.Int8Col(pos=22) fret_1 = tb.Int8Col(pos=23) fret_2 = tb.Int8Col(pos=24) fprob_1 = tb.Int8Col(pos=25) fprob_2 = tb.Int8Col(pos=26) fmask_1 = tb.Int8Col(pos=27) fmask_2 = tb.Int8Col(pos=28) fbord_1 = tb.Int8Col(pos=29) fbord_2 = tb.Int8Col(pos=30) ftrack_1 = tb.Int8Col(pos=31) ftrack_2 = tb.Int8Col(pos=32) inc_1 = tb.Float64Col(pos=33) inc_2 = tb.Float64Col(pos=34)
class LightningEvent(tables.IsDescription): event_id = tables.UInt32Col(pos=0) timestamp = tables.Time32Col(pos=1) corr_distance = tables.Int16Col(pos=2) uncorr_distance = tables.Int16Col(pos=3) uncorr_angle = tables.Float32Col(pos=4) corr_angle = tables.Float32Col(pos=5)
class HMMInfoParticle(tables.IsDescription): # HMM_ID, taste, din_channel, n_cells, time_start, time_end, thresh, # unit_type, n_repeats, dt, n_states, n_iters, BIC, cost, converged, # area hmm_id = tables.Int16Col() taste = tables.StringCol(45) channel = tables.Int16Col() n_cells = tables.Int32Col() unit_type = tables.StringCol(15) n_trials = tables.Int32Col() dt = tables.Float64Col() max_iter = tables.Int32Col() threshold = tables.Float64Col() time_start = tables.Int32Col() time_end = tables.Int32Col() n_repeats = tables.Int16Col() n_states = tables.Int32Col() n_iterations = tables.Int32Col() BIC = tables.Float64Col() cost = tables.Float64Col() converged = tables.BoolCol() fitted = tables.BoolCol() max_log_prob = tables.Float64Col() log_likelihood = tables.Float64Col() area = tables.StringCol(15) hmm_class = tables.StringCol(20) notes = tables.StringCol(40)
class AnonHMMInfoParticle(tables.IsDescription): # HMM_ID, taste, din_channel, n_cells, time_start, time_end, thresh, # unit_type, n_repeats, dt, n_states, n_iters, BIC, cost, converged, # area # info particle for anonymous hmm data, so if hdf5 store isn't tied to a # single recording, adds column for rec_dir hmm_id = tables.Int16Col() taste = tables.StringCol(45) channel = tables.Int32Col() n_cells = tables.Int32Col() unit_type = tables.StringCol(15) n_trials = tables.Int32Col() dt = tables.Float64Col() max_iter = tables.Int32Col() threshold = tables.Float64Col() time_start = tables.Int32Col() time_end = tables.Int32Col() n_repeats = tables.Int16Col() n_states = tables.Int32Col() n_iterations = tables.Int32Col() BIC = tables.Float64Col() cost = tables.Float64Col() converged = tables.BoolCol() fitted = tables.BoolCol() max_log_prob = tables.Float64Col() log_likelihood = tables.Float64Col() area = tables.StringCol(15) hmm_class = tables.StringCol(20) notes = tables.StringCol(30) rec_dir = tables.StringCol(150)
class Data(tables.IsDescription): ''' Description of data table, each row refers to an event/trace ''' receiver_table_n_i = tables.Int32Col() response_table_n_i = tables.Int32Col() time_table_n_i = tables.Int32Col() # #start_time = Time () # Start time of trace class time(tables.IsDescription): ''' Time, either epoch or human readable ''' type_s = tables.StringCol(8) # 'EPOCH', 'ASCII', or 'BOTH' epoch_l = tables.Int64Col() # Seconds since January 1, 1970 ascii_s = tables.StringCol(32) # WWW MMM DD HH:MM:SS YYYY micro_seconds_i = tables.Int32Col() # event_number_i = tables.Int32Col() # Event number channel_number_i = tables.Int8Col() # Channel number sample_rate_i = tables.Int16Col() # Trace sample rate sample_rate_multiplier_i = tables.Int16Col( ) # This will be needed for sample rates < 1 sps sample_count_i = tables.Int32Col() # Version 2007.191a bleeding stream_number_i = tables.Int8Col() # Stream raw_file_name_s = tables.StringCol(32) # Original file name array_name_data_a = tables.StringCol( 16) # Name of array that contains trace array_name_SOH_a = tables.StringCol(16) # The SOH array name array_name_event_a = tables.StringCol(16) # The event table array array_name_log_a = tables.StringCol(16) # The log array
class run_g2(tb.IsDescription): """ Row template for CAETÊ output data""" # ID row_id = tb.Int64Col(dflt=0, pos=0) date = tb.StringCol(itemsize=8, dflt="yyyymmdd", pos=1) grid_y = tb.Int16Col(dflt=0, pos=2) grid_x = tb.Int16Col(dflt=0, pos=3) csoil1 = tb.Float32Col(dflt=0.0, pos=4) csoil2 = tb.Float32Col(dflt=0.0, pos=5) csoil3 = tb.Float32Col(dflt=0.0, pos=6) csoil4 = tb.Float32Col(dflt=0.0, pos=7) sncN1 = tb.Float32Col(dflt=0.0, pos=8) sncN2 = tb.Float32Col(dflt=0.0, pos=8) sncN3 = tb.Float32Col(dflt=0.0, pos=10) sncN4 = tb.Float32Col(dflt=0.0, pos=11) sncP1 = tb.Float32Col(dflt=0.0, pos=12) sncP2 = tb.Float32Col(dflt=0.0, pos=13) sncP3 = tb.Float32Col(dflt=0.0, pos=14) sncP4 = tb.Float32Col(dflt=0.0, pos=15) inorg_n = tb.Float32Col(dflt=0.0, pos=16) inorg_p = tb.Float32Col(dflt=0.0, pos=17) sorbed_n = tb.Float32Col(dflt=0.0, pos=18) sorbed_p = tb.Float32Col(dflt=0.0, pos=19) hresp = tb.Float32Col(dflt=0.0, pos=20) nmin = tb.Float32Col(dflt=0.0, pos=21) pmin = tb.Float32Col(dflt=0.0, pos=22)
class WeatherConfig(tables.IsDescription): event_id = tables.UInt32Col(pos=0) timestamp = tables.Time32Col(pos=1) com_port = tables.UInt8Col(pos=2) baud_rate = tables.Int16Col(pos=3) station_id = tables.UInt32Col(pos=4) database_name = tables.Int32Col(dflt=-1, pos=5) help_url = tables.Int32Col(dflt=-1, pos=6) daq_mode = tables.BoolCol(pos=7) latitude = tables.Float64Col(pos=8) longitude = tables.Float64Col(pos=9) altitude = tables.Float64Col(pos=10) temperature_inside = tables.BoolCol(pos=11) temperature_outside = tables.BoolCol(pos=12) humidity_inside = tables.BoolCol(pos=13) humidity_outside = tables.BoolCol(pos=14) barometer = tables.BoolCol(pos=15) wind_direction = tables.BoolCol(pos=16) wind_speed = tables.BoolCol(pos=17) solar_radiation = tables.BoolCol(pos=18) uv_index = tables.BoolCol(pos=19) evapotranspiration = tables.BoolCol(pos=20) rain_rate = tables.BoolCol(pos=21) heat_index = tables.BoolCol(pos=22) dew_point = tables.BoolCol(pos=23) wind_chill = tables.BoolCol(pos=24) offset_inside_temperature = tables.Float32Col(pos=25) offset_outside_temperature = tables.Float32Col(pos=26) offset_inside_humidity = tables.Int16Col(pos=27) offset_outside_humidity = tables.Int16Col(pos=28) offset_wind_direction = tables.Int16Col(pos=29) offset_station_altitude = tables.Float32Col(pos=30) offset_bar_sea_level = tables.Float32Col(pos=31)
class run_g1(tb.IsDescription): """ Row template for CAETÊ output data""" # ID row_id = tb.Int64Col(dflt=0, pos=0) date = tb.StringCol(itemsize=8, dflt="yyyymmdd", pos=1) grid_y = tb.Int16Col(dflt=0, pos=2) grid_x = tb.Int16Col(dflt=0, pos=3) # Fluxees emaxm = tb.Float32Col(dflt=0.0, pos=4) tsoil = tb.Float32Col(dflt=0.0, pos=5) photo = tb.Float32Col(dflt=0.0, pos=6) aresp = tb.Float32Col(dflt=0.0, pos=7) npp = tb.Float32Col(dflt=0.0, pos=8) lai = tb.Float32Col(dflt=0.0, pos=9) f5 = tb.Float32Col(dflt=0.0, pos=10) rm = tb.Float32Col(dflt=0.0, pos=11) rg = tb.Float32Col(dflt=0.0, pos=12) wue = tb.Float32Col(dflt=0.0, pos=13) cue = tb.Float32Col(dflt=0.0, pos=14) cdef = tb.Float32Col(dflt=0.0, pos=15) vcmax = tb.Float32Col(dflt=0.0, pos=16) specific_la = tb.Float32Col(dflt=0.0, pos=17) nupt1 = tb.Float32Col(dflt=0.0, pos=18) nupt2 = tb.Float32Col(dflt=0.0, pos=19) pupt1 = tb.Float32Col(dflt=0.0, pos=20) pupt2 = tb.Float32Col(dflt=0.0, pos=21) pupt3 = tb.Float32Col(dflt=0.0, pos=22)
class run_g3(tb.IsDescription): """ Row template for CAETÊ output data""" # ID row_id = tb.Int64Col(dflt=0, pos=0) date = tb.StringCol(itemsize=8, dflt="yyyymmdd", pos=1) grid_y = tb.Int16Col(dflt=0, pos=2) grid_x = tb.Int16Col(dflt=0, pos=3) rcm = tb.Float32Col(dflt=0.0, pos=4) runom = tb.Float32Col(dflt=0.0, pos=5) evapm = tb.Float32Col(dflt=0.0, pos=6) wsoil = tb.Float32Col(dflt=0.0, pos=7) swsoil = tb.Float32Col(dflt=0.0, pos=8) cleaf = tb.Float32Col(dflt=0.0, pos=9) cawood = tb.Float32Col(dflt=0.0, pos=10) cfroot = tb.Float32Col(dflt=0.0, pos=11) litter_l = tb.Float32Col(dflt=0.0, pos=12) cwd = tb.Float32Col(dflt=0.0, pos=13) litter_fr = tb.Float32Col(dflt=0.0, pos=14) lnc1 = tb.Float32Col(dflt=0.0, pos=15) lnc2 = tb.Float32Col(dflt=0.0, pos=16) lnc3 = tb.Float32Col(dflt=0.0, pos=17) lnc4 = tb.Float32Col(dflt=0.0, pos=18) lnc5 = tb.Float32Col(dflt=0.0, pos=19) lnc6 = tb.Float32Col(dflt=0.0, pos=20) sto1 = tb.Float32Col(dflt=0.0, pos=21) sto2 = tb.Float32Col(dflt=0.0, pos=22) sto3 = tb.Float32Col(dflt=0.0, pos=23) c_cost = tb.Float32Col(dflt=0.0, pos=24)
class FEE(tb.IsDescription): """ Stores the parameters used by the EP simulation as metadata """ OFFSET = tb.Int16Col(pos=1) # displaces the baseline (e.g, 700) CEILING = tb.Int16Col(pos=2) # adc top count (4096) PMT_GAIN = tb.Float32Col(pos=3) # Gain of PMT (4.5e6) FEE_GAIN = tb.Float32Col(pos=4) # FE gain (250*ohm) R1 = tb.Float32Col(pos=5) # resistor in Ohms (2350*ohm) C1 = tb.Float32Col(pos=6) # Capacitor C1 in nF C2 = tb.Float32Col(pos=7) # Capacitor C2 in nF ZIN = tb.Float32Col(pos=8) # equivalent impedence DAQ_GAIN = tb.Float32Col(pos=9) NBITS = tb.Float32Col(pos=10) # number of bits ADC LSB = tb.Float32Col(pos=11) # LSB (adc count) NOISE_I = tb.Float32Col(pos=12) # Noise at the input NOISE_DAQ = tb.Float32Col(pos=13) # Noise at DAQ t_sample = tb.Float32Col(pos=14) # sampling time f_sample = tb.Float32Col(pos=15) # sampling frequency f_mc = tb.Float32Col(pos=16) # sampling frequency in MC (1ns) f_LPF1 = tb.Float32Col(pos=17) # LPF f_LPF2 = tb.Float32Col(pos=18) # LPF coeff_c = tb.Float64Col(shape=12, pos=19) # cleaning coeff coeff_blr = tb.Float64Col(shape=12, pos=20) # COEFF BLR adc_to_pes = tb.Float32Col(shape=12, pos=21) # CALIB CONST pmt_noise_rms = tb.Float32Col(shape=12, pos=22) # rms noise
class Info(tables.IsDescription): year = tables.Int16Col() station_id = tables.Int32Col() wban_id = tables.Int32Col() call_id = tables.StringCol(6) lat = tables.Float32Col() lon = tables.Float32Col() elevation = tables.Int16Col()
class DirectionReconstruction(tb.IsDescription): MC_Energy = tb.FloatCol(dflt=1, pos=1) N_LST = tb.Int16Col(dflt=1, pos=2) N_MST = tb.Int16Col(dflt=1, pos=3) N_SST = tb.Int16Col(dflt=1, pos=4) multiplicity = tb.Int64Col(dflt=1, pos=5) off_angle = tb.FloatCol(dflt=1, pos=6) offset = tb.FloatCol(dflt=1, pos=7)
class LightningStatus(tables.IsDescription): event_id = tables.UInt32Col(pos=0) timestamp = tables.Time32Col(pos=1) close_rate = tables.Int16Col(pos=2) total_rate = tables.Int16Col(pos=3) close_alarm = tables.BoolCol(pos=4) sever_alarm = tables.BoolCol(pos=5) current_heading = tables.Float32Col(pos=6)
class AMASS_ROW(pytables.IsDescription): fid = pytables.Int16Col(1) # 1-character String fname = pytables.Int32Col(1) # 1-character String gender = pytables.Int16Col(1) # 1-character String pose = pytables.Float32Col(52 * 3) # float (single-precision) dmpl = pytables.Float32Col(8) # float (single-precision) pose_matrot = pytables.Float32Col(52 * 9) # float (single-precision) betas = pytables.Float32Col(16) # float (single-precision) trans = pytables.Float32Col(3) # float (single-precision)
class MCHitInfo(tb.IsDescription): """Stores the simulated hits as metadata using Pytables. """ hit_position = tb.Float32Col(pos=0, shape=3) hit_time = tb.Float64Col(pos=1) hit_energy = tb.Float32Col(pos=2) label = tb.StringCol(20, pos=3) particle_indx = tb.Int16Col(pos=4) hit_indx = tb.Int16Col(pos=5)
class RecoEvent(tb.IsDescription): NTels_trigg = tb.Int16Col(dflt=1, pos=0) NTels_clean = tb.Int16Col(dflt=1, pos=1) EnMC = tb.Float32Col(dflt=1, pos=2) xi = tb.Float32Col(dflt=1, pos=3) DeltaR = tb.Float32Col(dflt=1, pos=4) ErrEstPos = tb.Float32Col(dflt=1, pos=5) ErrEstDir = tb.Float32Col(dflt=1, pos=6) h_max = tb.Float32Col(dflt=1, pos=7)
class ScanInfo(tables.IsDescription): rt = tables.Float32Col(pos=0) polarity = tables.Int16Col(pos=1) ms_level = tables.Int16Col(pos=2) max_mz = tables.Float32Col(pos=3) min_mz = tables.Float32Col(pos=4) # the rest are only relevant for ms2 spectra precursor_MZ = tables.Float32Col(pos=5) precursor_intensity = tables.Float32Col(pos=6) collision_energy = tables.Float32Col(pos=7)
class AMASS_ROW(pytables.IsDescription): gender = pytables.Int16Col(1) # 1-character String idx = pytables.Int16Col(1) # 1-character String frame = pytables.Int16Col(1) # 1-character String pose = pytables.Float32Col(24 * 3) # float (single-precision) pose_matrot = pytables.Float32Col(24 * 9) # float (single-precision) betas = pytables.Float32Col(10) # float (single-precision) trans = pytables.Float32Col(3) # float (single-precision) tightness = pytables.Float32Col(2) outfit = pytables.Int16Col(6)
class TimeSeries(tb.IsDescription): id = tb.Int16Col(pos=1) year = tb.Int16Col(pos=2) month = tb.Int16Col(pos=3) dh = tb.Float64Col(pos=4) se_dh = tb.Float64Col(pos=5) dg = tb.Float64Col(pos=6) se_dg = tb.Float64Col(pos=7) n_ad = tb.Int16Col(pos=8) n_da = tb.Int16Col(pos=9)
class digital_mapping_particle(tables.IsDescription): '''Pytables particle for storing digital input/output mappings ''' channel = tables.Int16Col() name = tables.StringCol(20) palatability_rank = tables.Int16Col() laser = tables.BoolCol() spike_array = tables.BoolCol() exclude = tables.BoolCol() laser_channels = tables.BoolCol()
class electrode_map_particle(tables.IsDescription): '''PyTables particle for storing electrode mapping ''' Electrode = tables.Int16Col() Port = tables.StringCol(5) Channel = tables.Int16Col() area = tables.StringCol(20) CAR_group = tables.Int16Col() dead = tables.BoolCol() cutoff_time = tables.Float32Col() clustering_result = tables.Int16Col()
class Reco(tables.IsDescription): """ Stores reconstructed hits """ event_indx = tables.Int32Col(pos=0) nof_hits = tables.Int16Col(pos=1) hit_indx = tables.Int16Col(pos=2) hit_position = tables.Float32Col(shape=3, pos=3) hit_energy = tables.Float32Col(pos=4) hit_geocorr = tables.Float32Col(pos=5) hit_ltcorr = tables.Float32Col(pos=6)
class EaarlGps(tables.IsDescription): sod = tables.Float32Col(pos=3) lon = tables.Float64Col(pos=0) lat = tables.Float64Col(pos=1) alt = tables.Float32Col(pos=2) pdop = tables.Float32Col(pos=4) xrms = tables.Float32Col(pos=5) veast = tables.Float32Col(pos=6) vnorth = tables.Float32Col(pos=7) vup = tables.Float32Col(pos=8) sv = tables.Int16Col(pos=9) flag = tables.Int16Col(pos=10)
class S2Si(tb.IsDescription): """ Store for a S2Si The table maps a S2Si peak is the same than the S2 peak nsipm gives the SiPM number only energies are stored (times are defined in S2) """ event = tb.Int32Col(pos=0) peak = tb.UInt8Col(pos=1) # peak number nsipm = tb.Int16Col(pos=2) # sipm number nsample = tb.Int16Col(pos=3) # sample number ene = tb.Float32Col(pos=4) # energy in pes
class MCParticleInfo(tb.IsDescription): """Stores the simulated particles as metadata using Pytables. """ particle_indx = tb.Int16Col(pos=0) particle_name = tb.StringCol(20, pos=1) primary = tb.Int16Col(pos=2) mother_indx = tb.Int16Col(pos=3) initial_vertex = tb.Float32Col(pos=4, shape=4) final_vertex = tb.Float32Col(pos=5, shape=4) initial_volume = tb.StringCol(20, pos=6) final_volume = tb.StringCol(20, pos=7) momentum = tb.Float32Col(pos=8, shape=3) kin_energy = tb.Float32Col(pos=9) creator_proc = tb.StringCol(20, pos=10)
class HisparcEvent(tables.IsDescription): # DISCUSS: use of signed (dflt -1) vs unsigned (labview code) event_id = tables.UInt32Col(pos=0) timestamp = tables.Time32Col(pos=2) nanoseconds = tables.UInt32Col(pos=3) ext_timestamp = tables.UInt64Col(pos=4) data_reduction = tables.BoolCol(pos=5) trigger_pattern = tables.UInt32Col(pos=6) baseline = tables.Int16Col(shape=4, dflt=-1, pos=7) std_dev = tables.Int16Col(shape=4, dflt=-1, pos=8) n_peaks = tables.Int16Col(shape=4, dflt=-1, pos=9) pulseheights = tables.Int16Col(shape=4, dflt=-1, pos=10) integrals = tables.Int32Col(shape=4, dflt=-1, pos=11) traces = tables.Int32Col(shape=4, dflt=-1, pos=12) event_rate = tables.Float32Col(pos=13)
class FontGlyphData(tb.IsDescription): index = tb.IntCol(pos=1) charcode = tb.IntCol(pos=2) unichar = tb.StringCol(8, pos=3) offset_x = tb.Int16Col(pos=4) offset_y = tb.Int16Col(pos=5) width = tb.UInt8Col(pos=6) height = tb.UInt8Col(pos=7) atlas_x = tb.UInt16Col(pos=8) atlas_y = tb.UInt16Col(pos=9) atlas_w = tb.UInt16Col(pos=10) atlas_h = tb.UInt16Col(pos=11) tex_x1 = tb.Float32Col(pos=12) tex_y1 = tb.Float32Col(pos=13) tex_x2 = tb.Float32Col(pos=14) tex_y2 = tb.Float32Col(pos=15)
class AMASS_Params_Row(tables.IsDescription): subject = tables.Int16Col(pos=1) gender = tables.Int8Col(pos=2) shape = tables.Float32Col(16, pos=3) pose = tables.Float32Col(52 * 3, pos=4) dmpl = tables.Float32Col(8, pos=5) trans = tables.Float32Col(3, pos=6)
class Time(tables.IsDescription): ''' Time correction table ''' class das(tables.IsDescription): manufacturer_s = tables.StringCol(64, pos=3) model_s = tables.StringCol(64, pos=2) serial_number_s = tables.StringCol(64, pos=1) notes_s = tables.StringCol(1024, pos=4) # Time of first lock class start_time(tables.IsDescription): type_s = tables.StringCol(8) epoch_l = tables.Int64Col() ascii_s = tables.StringCol(32) micro_seconds_i = tables.Int32Col() # Time of ending lock class end_time(tables.IsDescription): type_s = tables.StringCol(8) epoch_l = tables.Int64Col() ascii_s = tables.StringCol(32) micro_seconds_i = tables.Int32Col() slope_d = tables.Float64Col() # Slope offset_d = tables.Float64Col() # Offset at end time description_s = tables.StringCol(1024) corrected_i = tables.Int16Col()
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)