コード例 #1
0
def getDiscriptiveTalkWithWidth(inpath, Start,End, nameFiles, DynEnd, Width,TalkType,Person):
	#get discription information of the data
	#width mean how long do you want to check the characteristics
	#DynEnd dynamic ending
	#GazeType 
	ori = []
	for nameFile in nameFiles:
		print (nameFile)
		for i in [1,2]:
			print (i)
			(dataTHroot, dataTSroot, dataGroot) = ATS.readInput(inpath, nameFile,i)
			if DynEnd: #using dynamic ending 
				(yTH, xTH) = (dataTHroot.shape)
				(yTS, xTS) = (dataTSroot.shape)
				(yG, xG) = (dataGroot.shape)
				End = np.amin(np.asarray([yTH,yTS,yG])) #get the actual end time
			dataTHroot = ATS.shortenData(dataTHroot,Start,End)
			dataTSroot = ATS.shortenData(dataTSroot,Start,End)
			dataGroot = ATS.shortenData(dataGroot,Start,End)
			j = 0

			while j < End:		
				startSub = j
				if j+ Width > End:
					endSub = End 
				else:
					endSub = j+Width

				dataTH = ATS.shortenData(dataTHroot,startSub,endSub)
				dataTS = ATS.shortenData(dataTSroot,startSub,endSub)
				dataG = ATS.shortenData(dataGroot,startSub,endSub)
				if Person == 'H': 
					dataGTH  = ATS.combineData(dataTH,dataG,endSub)
					dataGTHS  = ATS.combineData(dataGTH,dataTS,endSub)
				else:
					dataGTS  = ATS.combineData(dataTS,dataG,endSub)
					dataGTHS  = ATS.combineData(dataGTS,dataTH,endSub)
				#print (dataGTHS)
				dataGTHS = formatOneCollumnOfData(dataGTHS,1,TalkType)
				ori = updateDiscriptiveData(ori,dataGTHS,1,nameFile,i,j)

				j = j + Width
	# for i in ori:
	# 	print (i)
	return ori
コード例 #2
0
def getDiscriptiveTwoTalkWithWidth(inpath, Start,End, nameFiles, DynEnd, Width,GoT):
	#get discription information of the data
	#width mean how long do you want to check the characteristics
	#DynEnd dynamic ending

	ori = []
	for nameFile in nameFiles:
		print (nameFile)
		for i in [1,2]:
			print (i)
			(dataTHroot, dataTSroot, dataGroot) = ATS.readInput(inpath, nameFile,i)
			if DynEnd: #using dynamic ending 
				(yTH, xTH) = (dataTHroot.shape)
				(yTS, xTS) = (dataTSroot.shape)
				(yG, xG) = (dataGroot.shape)
				End = np.amin(np.asarray([yTH,yTS,yG])) #get the actual end time
			dataTHroot = ATS.shortenData(dataTHroot,Start,End)
			dataTSroot = ATS.shortenData(dataTSroot,Start,End)
			dataGroot = ATS.shortenData(dataGroot,Start,End)
			dataTHSroot = combinedTwoTalkTogether(dataTHroot,dataTSroot)
			j = 0

			while j < End:		
				startSub = j
				if j+Width > End:
					endSub = End 
				else:
					endSub = j+Width

				dataG = ATS.shortenData(dataGroot,startSub,endSub)
				dataTHS = ATS.shortenData(dataTHSroot,startSub,endSub)

				if GoT == 0:
					dataGTHS  = ATS.combineData(dataG,dataTHS,endSub)
				else:
					dataGTHS  = ATS.combineData(dataTHS,dataG,endSub)
				
				ori = updateDiscriptiveDataForBothTalks(ori,dataGTHS,GoT,nameFile,i,j)
				
				j = j + Width

	return ori