changeset 219:ddc8c47db3df

Fix allan deviation plot
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 02 May 2014 16:33:24 +0200
parents a3494d2806ee
children 28a4ff70fe48
files Allan.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Allan.c	Fri May 02 16:32:50 2014 +0200
+++ b/Allan.c	Fri May 02 16:33:24 2014 +0200
@@ -26,8 +26,8 @@
 	Instance->control = control;
 	
 	SetPanelAttribute(Instance->AllanPanel, ATTR_TITLE, title); 
-	SetPanelAttribute (Instance->AllanPanel, ATTR_CALLBACK_DATA, (void *)Instance);
-	DisplayPanel (Instance->AllanPanel);
+	SetPanelAttribute(Instance->AllanPanel, ATTR_CALLBACK_DATA, (void *)Instance);
+	DisplayPanel(Instance->AllanPanel);
 	SetCtrlVal(Instance->AllanPanel, ALLANPANEL_NORMALIZER, normalization);
 }
 
@@ -104,9 +104,13 @@
 	SetCtrlVal(Instance->AllanPanel, ALLANPANEL_DRIFT, Instance->Drift);
 	
 	for (i = 0; i < ALLAN_NUM_DATAPOINTS; i++) {
-		if (Instance->AllanVar[i] == 0.0)
-			break;
 		x[i] = pow(2, i);
+		
+		if (Instance->AllanVar[i] == 0.0) {
+			y[i] = 0.0;
+			continue;
+		}
+		
 		/* remove  linear drift estimated contribution to the allan variance */
 		if (dedrift) {
 			double corr = 0.5 * (Instance->Drift * x[i]) * (Instance->Drift * x[i]);