Index: tools/ddd/Functions.cpp
===================================================================
--- tools/ddd/Functions.cpp	(revision 66)
+++ tools/ddd/Functions.cpp	(revision 74)
@@ -154,8 +154,13 @@
 	      buffer = strtok(NULL, delim);
 	      pixel = atoi(buffer);
+	      	
+	      //usual M0 mapping
+	      //int binx = 5-(int((superpixel-1)/3)*2)-(int((pixel%4)/2));
+	      //int biny = 5-(((superpixel-1)%3)*2)-(int((pixel-1)/2));
 	      	      
-	      int binx = 5-(int((superpixel-1)/3)*2)-(int((pixel%4)/2));
-	      int biny = 5-(((superpixel-1)%3)*2)-(int((pixel-1)/2));
-	      
+	      //M0 upside down
+	      int binx = 5-(5-(int((superpixel-1)/3)*2)-(int((pixel%4)/2)));
+	      int biny = 5-(5-(((superpixel-1)%3)*2)-(int((pixel-1)/2)));
+
 	      //search maximum sample amplitude within user specified window
 	      //start bin is always smaller than stop bin (taken care of by updated ranges)
