IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2019, 8:47:40 AM (7 years ago)
Author:
eugene
Message:

add vwtmean, virls, medimage wtmean & irls options, spline print

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/mana/deimos_mkobj.c

    r40661 r40662  
    190190    if (psf) Npof -= Npsf;
    191191
     192    // integral and fractional pixel offsets of PSF (none, by default)
     193    int dxi = 0;
     194    float dxf = 0.0, dxr = 1.0;
     195   
    192196    if (psf_trace) {
    193       float dx = -spline_apply_dbl (psf_trace->xk, psf_trace->yk, psf_trace->y2, psf_trace->Nknots, iy);
    194       Npof += dx;
    195     }
     197      float dx = spline_apply_dbl (psf_trace->xk, psf_trace->yk, psf_trace->y2, psf_trace->Nknots, iy);
     198      dxi = floor(dx);
     199      dxf = dx - dxi;  // -1.7 -> +0.3, -0.5 -> +0.5, +0.5 ->+0.5, +1.7 -> +0.7
     200      dxr = 1 - dxf;
     201      Npof += dxi;
     202      if (iy % 200 == 0) { fprintf (stderr, "%d : %f : %d : %f %f\n", iy, dx, dxi, dxf, dxr); }
     203    }
     204
     205    // if fractional offset is small, do not interpolate
     206    int doInterp = fabs(dxf) < 1e-5 ? FALSE : TRUE;
    196207
    197208    // flux = obj * PSF + sky
     
    205216        // only add in the flux if we are in range of the PSF
    206217        if ((n >= 0) && (n < NpsfFull)) {
    207           value += objVy * psfV[n];
     218          if (doInterp) {
     219            if ((n > 0) && (n < NpsfFull)) {
     220              value += objVy*psfV[n]*dxr + objVy*psfV[n-1]*dxf;
     221            }
     222            if (n == 0) {
     223              value += objVy*psfV[n]*dxr;
     224            }
     225          } else {
     226            value += objVy*psfV[n];
     227          }
    208228        }
    209229      } else {
Note: See TracChangeset for help on using the changeset viewer.