   myspherer.offsety = (ty * 2 + myspherer.baseoffsety);
   myspherer.extrax = bx;
   myspherer.extray = by;
-  myspherer.lfactor = 0.25 / sqrt(lsum) * (((int) /*bx*/ 0)) + 1.0;
+  //myspherer.lfactor = 0.25 / sqrt(lsum) * (((int) bx 0)) + 1.0;
+  myspherer.lfactor = pow(1.04, bx - 24 * 0.5); 
+//  myspherer.ebase = (0 + bx) * 1e-4;
+  myspherer.ebase = -lsum * (myspherer.lfactor - 1) / 46215;
+  myspherer.ebase = 0;
 //    myspherer.lfactor = 1.0;
 
   float intensity = thrust::reduce(thrust::seq,

  float baseoffsetx;
  float baseoffsety;
  float lfactor;
  float offsetx, offsety;
  float r;
  int extrax;

	    }
	}
      
//      if (psum - lsum < 2500) continue;
      dim3 grid(32, 1, 1350);
      dim3 block(11, 16, 1);

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