   boost::multi_array<short, 2> photonVals(extents[NY][NX]);
   thrust::device_vector<short> dPhotons(NY * NX);
   thrust::device_vector<float> dLambdas(NY * NX);
-  thrust::device_vector<float> dIntensity(50 * 300 * 1200);
-  thrust::host_vector<float> hIntensity(50 * 300 * 1200);
-  thrust::device_vector<float> dIntensity2(50 * 300 * 1200);
-  thrust::host_vector<float> hIntensity2(50 * 300 * 1200);
+  thrust::device_vector<float> dIntensity(175000000);
+  thrust::host_vector<float> hIntensity(175000000);
+  thrust::device_vector<float> dIntensity2(175000000);
+  thrust::host_vector<float> hIntensity2(175000000);
 
   idealsphere spherer(dPhotons, dLambdas);
 

	}
	if (hIntensity[k] < minval) minval = hIntensity[k];
}
	int maxR = maxidx / 2800 / 1;
	int maxX = maxidx % 7;
	int maxY = (maxidx / 7) % 400;

      printf("%d %d %lf %g %g %g %d %d %d %d %g\n", img, psum, lsum, minval, maxval, hIntensity[0], maxR, maxX, maxY, cudaGetLastError(), maxint);
      fflush(stdout);
    }
}

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

      spherer.rfactor = 0.005;
      spherer.roffset = -10;
      spherer.baseoffsetx = NX / 2 - 10 - 51 - 0.5; // good val -10
      spherer.baseoffsety = NY / 2 + 10 - 51 - 0.5; // good val +10
      dPhotons.assign(photonVals.data(), photonVals.data() + NY * NX);
      dLambdas.assign(lambdaVals.data(), lambdaVals.data() + NY * NX);
      
