 
   idealsphere spherer(dPhotons, dLambdas);
 
-  for (int img = 0; img < 2779; img++)
+  for (int img = 0; img < fullsize[0]; img++)
     {
       offset[0] = img;
       lambdaSpace.selectHyperslab(H5S_SELECT_SET, count, offset);
+      expectedLambdaSpace.selectHyperslab(H5S_SELECT_SET, count, offset);
       photonSpace.selectHyperslab(H5S_SELECT_SET, count, offset);
       lambdas.read(lambdaVals.data(), H5::PredType::NATIVE_FLOAT, memSpace, lambdaSpace);
       photons.read(photonVals.data(), H5::PredType::NATIVE_SHORT, memSpace, photonSpace);
-
       int psum = 0;
       double lsum = 0;
       for (int y = 0; y < NY; y++)
 	{
 	  for (int x = 0; x < NX; x++)
 	    {
-	      if (((y > 195 && y < 231) || y < 36 || ((x < 255  || (x < 300 && (y > 124 && y < 325))) && (y > 92 || x > 170 || x < 90)) && !(x<55 && y > 374))
+/*	      if (((y > 195 && y < 231) || y < 36 || ((x < 255  || (x < 300 && (y > 124 && y < 325))) && (y > 92 || x > 170 || x < 90)) && !(x<55 && y > 374))
 	      || y < 105 || y > 343)
+	      {
+		photonVals[y][x] = 0;
+		lambdaVals[y][x] = 0;
+	      }*/
+	      if (y < 233 || (x < 300 && y < 314) || x < 255)
+//	      if (y < 233 || (x < 350 && y < 370) || x < 255)
 	      {
 		photonVals[y][x] = 0;
 		lambdaVals[y][x] = 0;

	    }
	}
      
      dim3 grid(1, 50, 1200);
      dim3 block(32, 32, 1);

      spherer.rfactor = 0.005;

#include <thrust/execution_policy.h>
#include <thrust/device_vector.h>
#include <thrust/copy.h>
#include <string>
#include "math_constants.h"

using boost::multi_array;
using boost::extents;
using namespace std;

const int NX = 414;
const int NY = 414;
