Ejemplo n.º 1
0
		title='Tsa-Tse without background traffic '
	elif index==2:
		timestamp_former=dp.read_file('edison/data.txt',0)
		timestamp_backer=dp.read_file("serial/data.txt",2)
		title='Edison-Serial'
	elif index==3:
		timestamp_former=dp.read_file('edison/data3.txt',3)##edison receiver
		timestamp_backer=dp.read_file('edison/data3.txt',0)##edison sender
		
		###if sync ? ie , remove offset??
		#timestamp_backer=dp.time_sync(timestamp_backer,offset)
		title='Network delay (Mac_receiver-Edison_send)'
	elif index==4:
		title='ptpd'
	##error=former-backer
	if index!=4:
		error_data=dp.data_process_2(timestamp_former,timestamp_backer)
		print error_data
                if error_data:## check list is empty
			statistics=[dp.compute_statistics(error_data)]
        '''	
	elif index==4:
		error_data=offset
		statistics=[[0,0,0]]
        '''
	#print offset
	#print error_data
	#print statistics
	draw.curve(error_data,title,statistics)
Ejemplo n.º 2
0
Archivo: draw.py Proyecto: xiao-bo/PaaS
	##set legend position
	curve.legend(bbox_to_anchor=(1.05, 1.05))
	
	plt.show()



if __name__=="__main__":
        ## main code for multicurve

	print "draw.py"
	
	timestamp_former=dp.read_file('edison/data/0%.txt',3)##edison receiver
	timestamp_backer=dp.read_file('edison/data/0%.txt',0)##edison sender
	zero_data=dp.data_process_2(timestamp_former,timestamp_backer)

	timestamp_former=dp.read_file('edison/data/20%.txt',3)##edison receiver
	timestamp_backer=dp.read_file('edison/data/20%.txt',0)##edison sender
	ten_data=dp.data_process_2(timestamp_former,timestamp_backer)

	timestamp_former=dp.read_file('edison/data/50%.txt',3)##edison receiver
	timestamp_backer=dp.read_file('edison/data/50%.txt',0)##edison sender
	five_data=dp.data_process_2(timestamp_former,timestamp_backer)

	timestamp_former=dp.read_file('edison/data/90%.txt',3)##edison receiver
	timestamp_backer=dp.read_file('edison/data/90%.txt',0)##edison sender
	nine_data=dp.data_process_2(timestamp_former,timestamp_backer)

	zero_statistics=dp.compute_statistics(zero_data)
	ten_statistics=dp.compute_statistics(ten_data)