IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 11, 2008, 6:12:42 PM (18 years ago)
Author:
Paul Price
Message:

Correcting stack variances for the imperfect convolution. Changed (again) the way the deviations are calculated; they're now straight chi2, which allows us to estimate how the variance factor needs to be changed in order to correct for it. Moving additional values into pmSubtractionKernels so that this can be calculated from a kernel that has been read in (very useful for debugging, also nice to have a record of the quality of the fit).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmStack.c

    r19487 r19532  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-09-11 20:52:16 $
     10 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2008-09-12 04:12:42 $
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
    1313 *
     
    3030#define PIXEL_LIST_BUFFER 100           // Number of entries to add to pixel list at a time
    3131#define PIXEL_MAP_BUFFER 2              // Number of entries to add to pixel map at a time
    32 //#define VARIANCE_FACTORS                // Use variance factors when calculating the variances?
     32#define VARIANCE_FACTORS                // Use variance factors when calculating the variances?
    3333#define NUM_DIRECT_STDEV 5              // For less than this number of values, measure stdev directly
    3434
     
    312312              // Use variance to check that the two are consistent
    313313              float diff = pixelData->data.F32[0] - pixelData->data.F32[1];
    314 #if VARIANCE_FACTORS
     314#ifdef VARIANCE_FACTORS
    315315              float sigma2 = pixelVariances->data.F32[0] * varFactors->data.F32[pixelSources->data.U16[0]] +
    316316                  pixelVariances->data.F32[1] * varFactors->data.F32[pixelSources->data.U16[1]];
     
    346346                  float rej2 = PS_SQR(rej); // Rejection level squared
    347347                  for (int i = 0; i < num; i++) {
    348 #if VARIANCE_FACTORS
     348#ifdef VARIANCE_FACTORS
    349349                      pixelVariances->data.F32[i] *= rej2 * varFactors->data.F32[pixelSources->data.U16[i]];
    350350#else
     
    538538
    539539/// Constructor
    540 pmStackData *pmStackDataAlloc(pmReadout *readout, float weight)
     540pmStackData *pmStackDataAlloc(pmReadout *readout, float weight, float addVariance)
    541541{
    542542    pmStackData *data = psAlloc(sizeof(pmStackData)); // Stack data, to return
     
    547547    data->inspect = NULL;
    548548    data->weight = weight;
     549    data->addVariance = addVariance;
    549550
    550551    return data;
     
    602603        }
    603604        varFactors->data.F32[i] = vf;
     605        if (isfinite(data->addVariance)) {
     606            varFactors->data.F32[i] *= data->addVariance;
     607        }
    604608        if (!haveRejects && !data->inspect) {
    605609            data->inspect = psPixelsAllocEmpty(PIXEL_LIST_BUFFER);
Note: See TracChangeset for help on using the changeset viewer.