Example #1
0
	def plotl2(self, startn=1, endn=10):
		xloops, yloops = [], []
		xlines, ylines = [], []
		x, y = [], []
		for i in range(startn, endn):
			print("plotl2: now on i = {} of {} [memory @ {}]".format(i, endn,
					resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 1000**2
				), end='\r')
			_y = []
			try:
				avloops = self.loops.avg_displacements(i)
				yloops.append(avloops)
			except Exception as e:
				pass
			else:
				xloops.append(i)
				_y += avloops
			try:
				avlines = self.lines.avg_displacements(i)
				ylines.append(avlines)
			except Exception as e:
				pass
			else:
				xlines.append(i)
				_y += avlines
			if len(_y) == 0:
				continue
			x.append(i)
			y.append(_y)

		yerr = [stats.stdev(i) for i in y]
		y = [stats.mean(i) for i in y]

		print("plotl2: now on i = {} of {} [memory@{}]".format(endn, endn,
					resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 1000**2
				))
		print("Done.")

		assert len(y) == len(yerr)
		self._save_function_data(x, y, yerr)
		vis._log_log_plot(x, y, "Length vs. Displacement", "Log (segment length)", "Log (end to end dist)", yerr=yerr)
Example #2
0
	def plotlength2dens(self, maxp=None):
		x, y, yerr = self._yerr(self.loops.xy_length2dens(maxp=maxp))
		self._save_function_data(x, y, yerr)
		vis._log_log_plot(x, y, "Loop length vs density", "Log (loop length)", "Log (density)", yerr=yerr)
Example #3
0
	def plotvol2surf(self):
		x, y, yerr = self._yerr(self.loops.xy_vol2surf(), nonZero=True)
		self._save_function_data(x, y, yerr)
		vis._log_log_plot(x, y, "Loop perimeter vs vol2surf", "Log (loop perimeter)", "Log (loop vol2surf)", yerr=yerr)
Example #4
0
	def plotperim2dens(self, maxp=None):
		x, y, yerr = self._yerr(self.loops.xy_perim2dens(maxp=maxp))
		self._save_function_data(x, y, yerr)
		vis._log_log_plot(x, y, "Loop perimeter vs density", "Log (loop perimeter)", "Log (loop density)", yerr=yerr)
Example #5
0
	def plotperimeter(self):
		x, y, yerr = self._yerr(self.loops.xy_perimeter(), nonZero=True)
		# print(len(self.lines.strings[0]))
		self._save_function_data(x, y, yerr)
		vis._log_log_plot(x, y, "Loop perimeter vs length", "Log (loop perimeter)", "Log (length)", yerr=yerr)