Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_spike_table_description(self, pre, post, nfeatures):
class SpikeTableDescription(tables.IsDescription):
time = tables.UInt64Col()
channel = tables.UInt8Col()
wave = tables.Float64Col(shape=(pre + post))
cluster = tables.UInt8Col()
features = tables.Float64Col(shape=(nfeatures))
return SpikeTableDescription
transAmount = tb.UInt64Col() #IGNORE:E1101
transCount = tb.UInt64Col() #IGNORE:E1101
class H5Index(tb.IsDescription):
"""HDF5扩展K线数据格式(周线、月线、季线、半年线、年线、15分钟线、30分钟线、60分钟线"""
datetime = tb.UInt64Col() #IGNORE:E1101
start = tb.UInt64Col() #IGNORE:E1101
class H5Transaction(tb.IsDescription):
"""分笔数据"""
datetime = tb.UInt64Col()
price = tb.UInt64Col()
vol = tb.UInt64Col()
buyorsell = tb.UInt8Col()
class H5TransactionIndex(tb.IsDescription):
"""分笔数据按天索引"""
datetime = tb.UInt64Col()
start = tb.UInt64Col()
class H5MinuteTime(tb.IsDescription):
"""分时线"""
datetime = tb.UInt64Col()
price = tb.UInt64Col()
vol = tb.UInt64Col()
#------------------------------------------------------------------------------
slv_ch2_voltage = tables.Float64Col()
slv_ch1_current = tables.Float64Col()
slv_ch2_current = tables.Float64Col()
slv_comp_thres_low = tables.Float64Col()
slv_comp_thres_high = tables.Float64Col()
slv_max_voltage = tables.Float64Col()
slv_reset = tables.BoolCol()
slv_ch1_gain_pos = tables.UInt8Col()
slv_ch1_gain_neg = tables.UInt8Col()
slv_ch2_gain_pos = tables.UInt8Col()
slv_ch2_gain_neg = tables.UInt8Col()
slv_ch1_offset_pos = tables.UInt8Col()
slv_ch1_offset_neg = tables.UInt8Col()
slv_ch2_offset_pos = tables.UInt8Col()
slv_ch2_offset_neg = tables.UInt8Col()
slv_common_offset = tables.UInt8Col()
slv_internal_voltage = tables.UInt8Col()
slv_ch1_adc_gain = tables.Float64Col()
slv_ch1_adc_offset = tables.Float64Col()
slv_ch2_adc_gain = tables.Float64Col()
slv_ch2_adc_offset = tables.Float64Col()
slv_ch1_comp_gain = tables.Float64Col()
slv_ch1_comp_offset = tables.Float64Col()
slv_ch2_comp_gain = tables.Float64Col()
slv_ch2_comp_offset = tables.Float64Col()
class HisparcWeather(tables.IsDescription):
event_id = tables.UInt32Col(pos=0)
timestamp = tables.Time32Col(pos=1)
temp_inside = tables.Float32Col(pos=2)
temp_outside = tables.Float32Col(pos=3)
def create_tables(h5, group, samplename, tileid, ncycles, nchannels):
class SeqQual(tables.IsDescription):
gcid = tables.Int64Col(pos=0)
istart = tables.Int16Col(pos=1)
seq = tables.StringCol(ncycles, pos=2)
qual = tables.UInt8Col(shape=(ncycles,), pos=3)
#intensity = tables.Int16Col(shape=(ncycles, nchannels), pos=5)
subgroup = h5.create_group(group, samplename,
'SQI arrays for sample {} from tile {}'.format(samplename, tileid))
seqqual = h5.create_table(subgroup, 'seqqual', SeqQual,
'Sequences and quality scores for sample {} from '
'tile {}'.format(samplename, tileid))
intensities = h5.create_earray(subgroup, 'intensities', tables.UInt8Atom(),
(0, ncycles, nchannels),
'Signal intensities for sample {} from tile {}'.format(samplename, tileid))
return seqqual, intensities
rotation of the station around its center
.. attribute:: N
number of detectors with at least one particle
"""
id = tables.UInt32Col()
station_id = tables.UInt8Col()
r = tables.Float32Col()
phi = tables.Float32Col()
x = tables.Float32Col()
y = tables.Float32Col()
alpha = tables.Float32Col()
N = tables.UInt8Col()
t1 = tables.Float32Col()
t2 = tables.Float32Col()
t3 = tables.Float32Col()
t4 = tables.Float32Col()
n1 = tables.Float32Col()
n2 = tables.Float32Col()
n3 = tables.Float32Col()
n4 = tables.Float32Col()
class ShowerParticle(tables.IsDescription):
"""Store information about shower particles reaching round level
This table stores particles from shower simulations. For example, AIRES
simulations produce ``grdpcles`` files containing all particles which
reached ground level. These files can be read and their contents can be
"""
from __future__ import print_function
import numpy as np
import tables
#'-**-**-**-**-**-**- user record definition -**-**-**-**-**-**-**-'
# Define a user record to characterize some kind of particles
class Particle(tables.IsDescription):
name = tables.StringCol(16) # 16-character String
idnumber = tables.Int64Col() # Signed 64-bit integer
ADCcount = tables.UInt16Col() # Unsigned short integer
TDCcount = tables.UInt8Col() # unsigned byte
grid_i = tables.Int32Col() # integer
grid_j = tables.Int32Col() # integer
pressure = tables.Float32Col() # float (single-precision)
energy = tables.Float64Col() # double (double-precision)
print()
print('-**-**-**-**-**-**- file creation -**-**-**-**-**-**-**-')
# The name of our HDF5 filename
filename = "tutorial1.h5"
print("Creating file:", filename)
# Open a file in "w"rite mode
h5file = tables.open_file(filename, mode="w", title="Test file")
slv_ch1_thres_low = tables.Float64Col()
slv_ch1_thres_high = tables.Float64Col()
slv_ch2_thres_low = tables.Float64Col()
slv_ch2_thres_high = tables.Float64Col()
slv_ch1_inttime = tables.Float64Col()
slv_ch2_inttime = tables.Float64Col()
slv_ch1_voltage = tables.Float64Col()
slv_ch2_voltage = tables.Float64Col()
slv_ch1_current = tables.Float64Col()
slv_ch2_current = tables.Float64Col()
slv_comp_thres_low = tables.Float64Col()
slv_comp_thres_high = tables.Float64Col()
slv_max_voltage = tables.Float64Col()
slv_reset = tables.BoolCol()
slv_ch1_gain_pos = tables.UInt8Col()
slv_ch1_gain_neg = tables.UInt8Col()
slv_ch2_gain_pos = tables.UInt8Col()
slv_ch2_gain_neg = tables.UInt8Col()
slv_ch1_offset_pos = tables.UInt8Col()
slv_ch1_offset_neg = tables.UInt8Col()
slv_ch2_offset_pos = tables.UInt8Col()
slv_ch2_offset_neg = tables.UInt8Col()
slv_common_offset = tables.UInt8Col()
slv_internal_voltage = tables.UInt8Col()
slv_ch1_adc_gain = tables.Float64Col()
slv_ch1_adc_offset = tables.Float64Col()
slv_ch2_adc_gain = tables.Float64Col()
slv_ch2_adc_offset = tables.Float64Col()
slv_ch1_comp_gain = tables.Float64Col()
slv_ch1_comp_offset = tables.Float64Col()
slv_ch2_comp_gain = tables.Float64Col()
slv_ch2_comp_offset = tables.Float64Col()
slv_ch2_inttime = tables.Float64Col()
slv_ch1_voltage = tables.Float64Col()
slv_ch2_voltage = tables.Float64Col()
slv_ch1_current = tables.Float64Col()
slv_ch2_current = tables.Float64Col()
slv_comp_thres_low = tables.Float64Col()
slv_comp_thres_high = tables.Float64Col()
slv_max_voltage = tables.Float64Col()
slv_reset = tables.BoolCol()
slv_ch1_gain_pos = tables.UInt8Col()
slv_ch1_gain_neg = tables.UInt8Col()
slv_ch2_gain_pos = tables.UInt8Col()
slv_ch2_gain_neg = tables.UInt8Col()
slv_ch1_offset_pos = tables.UInt8Col()
slv_ch1_offset_neg = tables.UInt8Col()
slv_ch2_offset_pos = tables.UInt8Col()
slv_ch2_offset_neg = tables.UInt8Col()
slv_common_offset = tables.UInt8Col()
slv_internal_voltage = tables.UInt8Col()
slv_ch1_adc_gain = tables.Float64Col()
slv_ch1_adc_offset = tables.Float64Col()
slv_ch2_adc_gain = tables.Float64Col()
slv_ch2_adc_offset = tables.Float64Col()
slv_ch1_comp_gain = tables.Float64Col()
slv_ch1_comp_offset = tables.Float64Col()
slv_ch2_comp_gain = tables.Float64Col()
slv_ch2_comp_offset = tables.Float64Col()
class HisparcWeather(tables.IsDescription):
event_id = tables.UInt32Col(pos=0)
timestamp = tables.Time32Col(pos=1)
def get_spikes_description(fetcol=None):
spikes_description = OrderedDict([
('time', tables.UInt64Col()),
('features', tables.Float32Col(shape=(fetcol,))),
('cluster_auto', tables.UInt32Col()),
('cluster_manual', tables.UInt32Col()),
('masks', tables.UInt8Col(shape=(fetcol,))),])
return spikes_description
slv_ch2_thres_high = tables.Float64Col()
slv_ch1_inttime = tables.Float64Col()
slv_ch2_inttime = tables.Float64Col()
slv_ch1_voltage = tables.Float64Col()
slv_ch2_voltage = tables.Float64Col()
slv_ch1_current = tables.Float64Col()
slv_ch2_current = tables.Float64Col()
slv_comp_thres_low = tables.Float64Col()
slv_comp_thres_high = tables.Float64Col()
slv_max_voltage = tables.Float64Col()
slv_reset = tables.BoolCol()
slv_ch1_gain_pos = tables.UInt8Col()
slv_ch1_gain_neg = tables.UInt8Col()
slv_ch2_gain_pos = tables.UInt8Col()
slv_ch2_gain_neg = tables.UInt8Col()
slv_ch1_offset_pos = tables.UInt8Col()
slv_ch1_offset_neg = tables.UInt8Col()
slv_ch2_offset_pos = tables.UInt8Col()
slv_ch2_offset_neg = tables.UInt8Col()
slv_common_offset = tables.UInt8Col()
slv_internal_voltage = tables.UInt8Col()
slv_ch1_adc_gain = tables.Float64Col()
slv_ch1_adc_offset = tables.Float64Col()
slv_ch2_adc_gain = tables.Float64Col()
slv_ch2_adc_offset = tables.Float64Col()
slv_ch1_comp_gain = tables.Float64Col()
slv_ch1_comp_offset = tables.Float64Col()
slv_ch2_comp_gain = tables.Float64Col()
slv_ch2_comp_offset = tables.Float64Col()
class HisparcWeather(tables.IsDescription):