IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 25, 2013, 4:52:31 PM (13 years ago)
Author:
eugene
Message:

fixed floor / int problem and failure to hit central pixel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130904/psModules/src/objects/pmModel_CentralPixel.c

    r36226 r36239  
    704704
    705705    float delta = 1.0 / (float) Nsub;
    706     float off = -Nsub2 * delta;
    707     for (float ix = off; ix < 0.5; ix += delta) {
    708         for (float iy = off; iy < 0.5; iy += delta) {
    709 
    710             float dX = dx + ix;
    711             float dY = dy + iy;
     706    // float off = -Nsub2 * delta;
     707
     708    int Sx = (int) floor(dx / delta);
     709    int Sy = (int) floor(dy / delta);
     710
     711    for (int ix = -Nsub2; ix <= Nsub2; ix++) {
     712      float dX = delta * (Sx + ix);
     713      for (int iy = -Nsub2; iy <= Nsub2; iy++) {
     714        float dY = delta * (Sy + iy);
    712715            float z = PS_SQR(dX / Rxx) + PS_SQR(dY / Ryy) + dX * dY * Rxy;
    713716
    714717            float q = pow (z, rindex);
    715718            float f = exp(-kappa*q);
     719
     720            // if ((ix == 0) && (iy == 0)) {
     721            //   // fprintf (stderr, "this: %f  %f  %f  --  full : %f %f\n", z, q, f, flux, (float) npix);
     722            // }
    716723
    717724            flux += f;
Note: See TracChangeset for help on using the changeset viewer.