From fd66690aa9c2dc429325891c906b97d5184bc5e0 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 28 Aug 2015 18:57:00 +0200 Subject: analyzing functions --- stats.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'stats.py') diff --git a/stats.py b/stats.py index a136ca9..b567800 100644 --- a/stats.py +++ b/stats.py @@ -297,7 +297,20 @@ class Stats: def analyze_deviations(self, celltype): ds = self.data.eject_deviations[celltype] - if len(ds) == 0: return - mean, stddev = fit_gaussian(ds) - print(celltype+" eject/split direction deviations: mean = "+str(mean)+", stddev="+str(stddev)) + try: + mean, stddev = fit_gaussian(ds) + except: + mean, stddev = "???", "???" + + print(celltype+" eject/split direction deviations: mean = "+str(mean)+", stddev="+str(stddev)+", ndata="+str(len(ds))) + + def analyze_distances(self, celltype): + ds = [v[0] for v in self.data.eject_distlogs[celltype]] + + try: + mean, stddev = fit_gaussian(ds) + except: + mean, stddev = "???", "???" + + print(celltype+" eject/split distances: mean = "+str(mean)+", stddev="+str(stddev)+", ndata="+str(len(ds))) -- cgit v1.2.3