IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20450


Ignore:
Timestamp:
Oct 28, 2008, 2:02:16 PM (18 years ago)
Author:
eugene
Message:

show residuals and analytical model components separately

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotVisual.c

    r20251 r20450  
    694694    psImageInit (psfMosaic, 0.0);
    695695   
     696    psImage *funMosaic = psImageAlloc (3*DX, 3*DY, PS_TYPE_F32);
     697    psImageInit (funMosaic, 0.0);
     698
     699    psImage *resMosaic = psImageAlloc (3*DX, 3*DY, PS_TYPE_F32);
     700    psImageInit (resMosaic, 0.0);
     701
    696702    pmModel *modelRef = pmModelAlloc(psf->type);
    697703
     
    700706        for (int y = -1; y <= +1; y ++) {
    701707            // use the center of the center pixel of the image
    702             float xc = (0.5 + 0.45*x)*readout->image->numCols + readout->image->col0;
    703             float yc = (0.5 + 0.45*y)*readout->image->numRows + readout->image->row0;
     708            float xc = (int)((0.5 + 0.45*x)*readout->image->numCols) + readout->image->col0 + 0.5;
     709            float yc = (int)((0.5 + 0.45*y)*readout->image->numRows) + readout->image->row0 + 0.5;
    704710
    705711            // assign the x and y coords to the image center
     
    718724            // XXX should we measure this for the analytical model only or the full model?
    719725            pmModelAddWithOffset (psfMosaic, NULL, model, PM_MODEL_OP_FULL | PM_MODEL_OP_CENTER, 0, -x*DX, -y*DY);
     726            pmModelAddWithOffset (funMosaic, NULL, model, PM_MODEL_OP_FUNC | PM_MODEL_OP_CENTER, 0, -x*DX, -y*DY);
     727            pmModelAddWithOffset (resMosaic, NULL, model, PM_MODEL_OP_RES0 | PM_MODEL_OP_RES1 | PM_MODEL_OP_CENTER, 0, -x*DX, -y*DY);
     728
    720729            psFree (model);
    721730        }
     
    723732
    724733    psImage *psfLogFlux = (psImage *) psUnaryOp (NULL, psfMosaic, "log");
    725     psphotVisualRangeImage (kapa2, psfLogFlux, "psf_mosaic", 1, -2.0, 3.0);
     734    psphotVisualRangeImage (kapa2, psfLogFlux, "psf_mosaic",    0, -2.0, 3.0);
     735    psphotVisualRangeImage (kapa2, funMosaic, "psf_analytical", 1, -10.0, 100.0);
     736    psphotVisualRangeImage (kapa2, resMosaic, "psf_residual",   2, -10.0, 100.0);
    726737
    727738    psFree (psfMosaic);
     739    psFree (funMosaic);
     740    psFree (resMosaic);
    728741    psFree (psfLogFlux);
    729742    psFree (modelRef);
Note: See TracChangeset for help on using the changeset viewer.