From 9cd5275df2e9bd75ce77317deff31322be5d396b Mon Sep 17 00:00:00 2001
From: Pilar Cossio <Pilar.Cossio@biophys.mpg.de>
Date: Tue, 17 Mar 2015 15:54:27 +0100
Subject: [PATCH] Print map modifications

---
 bioem.cpp       |  9 ++++++++-
 include/param.h |  1 +
 param.cpp       | 27 ++++++++++++++++++++++++---
 3 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/bioem.cpp b/bioem.cpp
index 8eef89c..dde3777 100644
--- a/bioem.cpp
+++ b/bioem.cpp
@@ -1013,6 +1013,13 @@ if(param.printrotmod) {
 	  irad=int( Model.points[n].radius / param.pixelSize );
 	  rad2= Model.points[n].radius * Model.points[n].radius;
 
+	 if (i < 0 || j < 0 || i >= param.param_device.NumberPixels || j >= param.param_device.NumberPixels)
+            {
+              if (DebugOutput >= 0) cout << "WARNING::: Model Point out of Projection map: " << i << ", " << j << "\n";
+              continue;
+            }
+
+
 	  //Projecting over the radius
 	  for(int ii= i - irad; ii < i + irad; ii++)
 	    {	
@@ -1040,7 +1047,7 @@ if(param.printrotmod) {
 
 	  if (i < 0 || j < 0 || i >= param.param_device.NumberPixels || j >= param.param_device.NumberPixels)
 	    {
-	      if (DebugOutput >= 3) cout << "Model Point out of map: " << i << ", " << j << "\n";
+	      if (DebugOutput >= 0) cout << "WARNING:::: Model Point out of Projection map: " << i << ", " << j << "\n";
 	      continue;
 	    }
 
diff --git a/include/param.h b/include/param.h
index 091cd5d..ee0ef44 100644
--- a/include/param.h
+++ b/include/param.h
@@ -49,6 +49,7 @@ public:
 	bool nocentermass;
 	bool printrotmod;
 	bool readquatlist;
+	bool showrotatemod;
 
         myfloat_t elecwavel;
 
diff --git a/param.cpp b/param.cpp
index 814e713..6fb85f4 100644
--- a/param.cpp
+++ b/param.cpp
@@ -247,9 +247,10 @@ int bioem_param::readParameters(const char* fileinput,const char* fileangles)
       else if (strcmp(token, "WRITE_CROSSCOR") == 0)//Key word if writing down full micrograph cross correlation
 	{
 	  param_device.writeCC = true;
+	  param_device.CCdisplace=10;
 	  cout << "Writing CrossCorrelations \n";
 	}
-      else if (strcmp(token, "CROSSCOR_GRID_SPACE") == 0)
+      else if (strcmp(token, "#CROSSCOR_GRID_SPACE") == 0)
 	{
 	  token = strtok(NULL, " ");
 	  param_device.CCdisplace=int(atoi(token));
@@ -370,6 +371,21 @@ int bioem_param::forprintBest(const char* fileinput)
 
   ifstream input(fileinput);
   withnoise=false;
+  showrotatemod=false;
+
+  param_device.flipped=false;
+  param_device.debugterm=false;
+  param_device.writeCC=false;
+  param_device.CCwithBayes=true;
+  writeCTF=false;
+  elecwavel=220;
+  ignoreCCoff=false;
+  doquater= false;
+  nocentermass=false;
+  printrotmod=false;
+  readquatlist=false;
+  doaaradius=true;
+
 
   if (!input.good())
     {
@@ -483,9 +499,13 @@ int bioem_param::forprintBest(const char* fileinput)
       else if (strcmp(token, "NO_PROJECT_RADIUS") == 0) //If projecting CA with amino-acid radius
 	{
 	  doaaradius = false;
-	  cout << "Projecting corresponding radius \n";
+	  cout << "Not projecting corresponding radius \n";
 	}
-
+      else if (strcmp(token, "PRINT_ROTATED_MODELS") == 0)//Number of Euler angle tripplets in non uniform Euler angle sampling
+        {
+                printrotmod=true;
+                cout << "PRINTING out rotatted models (best for debugging)\n";
+        }
 
     }
 
@@ -498,6 +518,7 @@ int bioem_param::forprintBest(const char* fileinput)
   gridCTF_phase = startGridCTF_phase;
   numberGridPointsEnvelop = 1 ;
   gridEnvelop = startGridEnvelop;
+  doquater=false;
 
   param_device.NumberFFTPixels1D = param_device.NumberPixels / 2 + 1;
   FFTMapSize = param_device.NumberPixels * param_device.NumberFFTPixels1D;
-- 
GitLab