IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2010, 4:16:19 AM (16 years ago)
Author:
Paul Price
Message:

Solve for the normalisation of the convolution kernel completely separately from that of the other kernel terms. We use a 'normalisation window', basically an aperture in which we measure the flux of the stamps to determine the normalisation value. This introduces a new recipe parameter, NORM.FRAC, which is the fraction of the total in the window at which we set the normalisation window/aperture. The quality of the result seems to be rather sensitive to this value. Also found a bug in the imposition of the penalty function in dual convolution mode: it wasn't being set for the second solution part. This seems to produce decent dual convolution subtractions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppSub/src/ppSubMatchPSFs.c

    r26667 r26703  
    2222#include "ppSub.h"
    2323
     24#define COVAR_FRAC 0.01                 // Truncation fraction for covariance matrix
     25
    2426// Normalise a region on an image
    2527static void normaliseRegion(psImage *image, // Image to normalise
     
    3840}
    3941
     42#if 0
    4043// Measure the PSF for an image
    4144static float subImagePSF(ppSubData *data, // Processing data
     
    8588    return fwhm;
    8689}
     90#endif
    8791
    8892// Scale the kernel parameters according to the PSFs
     
    114118    }
    115119
     120#if 0
    116121    // Input images
    117122    pmReadout *inRO = pmFPAfileThisReadout(config->files, view, "PPSUB.INPUT"); // Input readout
     
    133138    float inFWHM = subImagePSF(data, inRO, inSources); // FWHM for input
    134139    float refFWHM = subImagePSF(data, refRO, refSources); // FWHM for reference
     140#else
     141    float inFWHM = 7.631371;
     142    float refFWHM = 10.005879;
     143#endif
     144
    135145    psLogMsg("ppSub", PS_LOG_INFO, "Input FWHM: %f\nReference FWHM: %f\n", inFWHM, refFWHM);
    136146    if (!isfinite(inFWHM) || !isfinite(refFWHM)) {
     
    252262    float rej = psMetadataLookupF32(NULL, recipe, "REJ"); // Rejection threshold
    253263    float kernelErr = psMetadataLookupF32(NULL, recipe, "KERNEL.ERR"); // Relative systematic error in kernel
     264    float normFrac = psMetadataLookupF32(NULL, recipe, "NORM.FRAC"); // Fraction of window for normalisn windw
    254265    float sysErr = psMetadataLookupF32(NULL, recipe, "SYS.ERR"); // Relative systematic error in images
    255266    float skyErr = psMetadataLookupF32(NULL, recipe, "SKY.ERR"); // Additional error in sky
     
    306317    }
    307318
     319    if (inRO->covariance) {
     320        psImageCovarianceTruncate(inRO->covariance, COVAR_FRAC);
     321    }
     322    if (refRO->covariance) {
     323        psImageCovarianceTruncate(refRO->covariance, COVAR_FRAC);
     324    }
     325
    308326    // Match the PSFs
    309327    bool success = false;               // Operation was successful?
     
    315333                                     spacing, threshold, sources, data->stamps, type, size, order,
    316334                                     widths, orders, inner, ringsOrder, binning, penalty, optimum,
    317                                      optWidths, optOrder, optThresh, iter, rej, sysErr, skyErr, kernelErr, maskVal,
    318                                      maskBad, maskPoor, poorFrac, badFrac, subMode);
     335                                     optWidths, optOrder, optThresh, iter, rej, normFrac,
     336                                     sysErr, skyErr, kernelErr, maskVal, maskBad, maskPoor,
     337                                     poorFrac, badFrac, subMode);
    319338    }
    320339
     
    407426    pmConceptsCopyFPA(refConv->parent->parent->parent, refRO->parent->parent->parent, true, true);
    408427
     428    if (inConv->covariance) {
     429        psImageCovarianceTruncate(inConv->covariance, COVAR_FRAC);
     430    }
     431    if (refConv->covariance) {
     432        psImageCovarianceTruncate(refConv->covariance, COVAR_FRAC);
     433    }
     434
    409435    if (inConv->variance) {
    410436        psImageCovarianceTransfer(inConv->variance, inConv->covariance);
Note: See TracChangeset for help on using the changeset viewer.