本文整理汇总了Python中KHR1readcsv类的典型用法代码示例。如果您正苦于以下问题:Python KHR1readcsv类的具体用法?Python KHR1readcsv怎么用?Python KHR1readcsv使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KHR1readcsv类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writeout
def writeout():
l = []
out = ''
ser = serial.Serial("/dev/ttyUSB0", 115200)
l = KHR1readcsv.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
ser.open()
if ser.isOpen():
for x in l[0]:
out += (str(x))
print out
ser.write(out)
ser.close()
示例2: adjustGain
return original
#=== ADJUST GAINS FOR INDIVIDUAL CHANNEL ===
def adjustGain(self, gain, adjustment):
return list(numpy.add(gain, numpy.multiply(gain, adjustment)))
""" ==============================================
TESTS
==============================================
"""
motion = KHR1readcsv.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#motion = KHR1readcsv.read("/home/msunardi/Python-project/some_data.csv")
print "motion: ", motion
#motion = [[1,3,4,5,6,7,8,9,10,42,12,53,12,10,55,12,23],[32,42,12,63,23,23,53,1,5,6,2,32,17,84,23,10,44],[12,42,22,31,9,8,4,24,1,52,12,5,12,23,7,11,20]]
#print "motion list: ", motion
filt = kfilter(len(motion[0]))
#print "fb = ", filt.fb
filtered = []
filtered = filt.filterAll(motion)
gains = []
gains = filt.getGains(filtered)
示例3: MotionSynthesizer
- KHR1readcsv: read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
- interpolation: interpolate points
- multiresfilter: multiresolution filtering
=========================================
"""
ms = MotionSynthesizer()
#=== 1. Read motion file
mo_list = []
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/gait_back_roll.csv")
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/better_fwd_walk_data.csv")
#mo_list = readCSV("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")
#=== 2. Interpolate motion list >>> moved to last
#rs = ms.interpolate(mo_list)
#for r in zip(*rs):
# print r
#=== 3. Apply multiresolution filtering
#filtered = []
#=== 3.a. Extract low pass sequence by filtering (convolving with kernel)
#filtered = ms.multiresFiltering(rs)
#filtered = ms.multiresFiltering(mo_list)
i=0
示例4: motion
return self.bpb.bringItOn(filtered_data)
""" =========================================
Test:
- read KHR-1 .csv motion file
- interpolate the points
- ready the interpolated motion (in RCB-1 word format) for serial out Components:
- KHR1readcsv: read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
- interpolation: interpolate points
- filter: apply filtering to interpolated motion and get frequency bands for each channel
- bandpass: find bandpass for each frequency bands
=========================================
"""
mo_list = []
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")
kms = KHR1MotionSignal(mo_list)
print kms.returnBandsData(kms.filterData(kms.interpolate(mo_list)))
"""writer = csv.writer(open("test_convolved_data.csv", "wb"))
for rows in filtered:
writer.writerows(rows)
"""
示例5: interpolate
- read KHR-1 .csv motion file
- interpolate the points
- apply multiresolution filtering to the interpolated points
Modules:
- KHR1readcsv: read .csv motion file, and format it into a 2-D tuple: a list of KHR-1 channels, and each element is a list of motion for the channel
- interpolation: interpolate points
- multiresfilter: multiresolution filtering
=========================================
"""
mo_list = []
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/push_ups_data.csv")
#mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/somersault.csv")
mo_list = motion.read("/home/msunardi/Documents/thesis-stuff/KHR-1-motions/sweetescape_surf_right.csv")
rs = interpolate(mo_list)
filtered = []
filtered = multiresFiltering(rs)
i=0
j=0
for freq in filtered:
print "Frequency bands for Channel ",i," :"
for fbd in freq:
print "CH:",i,", FB_",j," = ", fbd
j += 1
j = 0
示例6: readCSV
def readCSV( self, path ):
return motion.read(path)
示例7: readCSV
def readCSV( path ):
return motion.read(path)