IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2009, 3:31:44 PM (17 years ago)
Author:
Paul Price
Message:

Correct image and variance for change in the plate scale.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpLoop.c

    r23753 r24328  
    297297    }
    298298
     299    // Correct image for change in the plate scale
     300    {
     301        psAssert(input && input->fpa && input->fpa->toSky, "Require astrometry for input");
     302        psAssert(outFPA && outFPA && outFPA->toSky, "Require astrometry for output");
     303
     304        double inScale = input->fpa->toSky->Xs + input->fpa->toSky->Ys; // Plate scale for input
     305        double outScale = outFPA->toSky->Xs + outFPA->toSky->Ys; // Plate scale for output
     306        float correction = PS_SQR(outScale / inScale); // Correction factor to apply to image
     307        psLogMsg("pswarp", PS_LOG_INFO, "Correcting flux by %f to account for pixel scales", correction);
     308
     309        psBinaryOp(output->image, output->image, "*", psScalarAlloc(correction, PS_TYPE_F32));
     310        if (output->variance) {
     311            psBinaryOp(output->variance, output->variance, "*",
     312                       psScalarAlloc(PS_SQR(correction), PS_TYPE_F32));
     313        }
     314    }
     315
     316
    299317    // Set variance factor
    300318    {
Note: See TracChangeset for help on using the changeset viewer.