 //      logLs.write(logLsVals.data(), H5::PredType::NATIVE_FLOAT, memSpace, expectedLambdaSpace);
       //expectedLambdaFile.flush(H5F_SCOPE_LOCAL);
       //hIntensity2.assign(dIntensity2.begin(), dIntensity2.end());
-	int maxR = maxidx / grid.y / block.y / grid.x / block.x;
-	int maxX = maxidx % block.x;
-	int maxY = (maxidx / (grid.x * block.x)) % block.y;
-	int maxI = (maxidx / (block.x * grid.x * block.y)) % grid.y;
-	int maxI2 = (maxidx / block.x) % grid.x;
-
-      printf("%d %d %lf %g %g %g %d %d %d %d %g %d %d\n", img, psum, lsum, minval, maxval, hIntensity[0], maxR, maxX, maxY, cudaGetLastError(), maxint, maxI, maxI2);
-      fflush(stdout);
+
     }
 }

//    if (rawx < 233 - extrax * 3) rawx += /*29*/ -18 + extrax * 3;
//    if (rawy < 226 - extray * 2) rawy += /*3*/ -12 + extray * 2;*/

    float x = rawx - offsetx;
    float y = rawy - offsety;
    
    float q = sqrt(x * x + y * y);
float val;
    float den = (2 * ((float) CUDART_PI_F) * q * r);
    if (r > 0.47e-4)
{
    if ( r < 1e-4)
{
    val = 3 * den;
    if (r < 0.5e-4)
    {
	val *= den;
    }
    if (r < 0.48e-4)
    {
       val /= sqrt(den);
    }
}
else
    val = 3 * (sinpif(2 * q * r)  - 2 * ((float) CUDART_PI_F) * q * r * cospif(2 * q * r));

    den = den * den * den;
    
    val /= den;
}
else
val = 1.0f;

// Global spherical convolution 
if (false)
{   
    float r = tid * 1e-4;
    den = (2 * ((float) CUDART_PI_F) * q * r);
    val *= 3 * (sinpif(2 * q * r)  - 2 * ((float) CUDART_PI_F) * q * r * cospif(2 * q * r));

    den = den * den * den;
    val /= den;
}
// Glocal circular convolution
if (false)
{   
    float r = tid * 1e-4;
    den = (2 * ((float) CUDART_PI_F) * q * r);
    val *= 2 * j1(den);
    
    val /= den;
}
// Global normal convolution
/*{
    float sigma = NX * 0.1 * tid;
    val *= exp(-q*q/(2*sigma*sigma));
}*/


    val = val * val;

    return val;
  }
};


intens[idx] = 0;*/
intensityfactor = 1e-13;
}
//  intensityfactor *= pow(1.0075, myspherer.tid - 64 * 0.5);
  likelihood likelihooder(myspherer, intensityfactor);

  return likelihooder;
