IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 5, 2009, 4:31:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging pap_branch_20090128. Resolved a small number of conflicts. Compiles, but not tested in detail.

File:
1 edited

Legend:

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

    r21183 r21363  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2009-01-27 06:39:38 $
     10 *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2009-02-06 02:31:25 $
    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?
     33//#define ADD_VARIANCE                  // Allow additional variance (besides variance factor)?
    3334#define NUM_DIRECT_STDEV 5              // For less than this number of values, measure stdev directly
    3435
     
    263264
    264265        psImage *image = data->readout->image; // Image of interest
    265         psImage *variance = data->readout->weight; // Variance ("weight") map of interest
     266        psImage *variance = data->readout->variance; // Variance map of interest
    266267        pixelData->data.F32[num] = image->data.F32[yIn][xIn];
    267268        if (variance) {
     
    442443    *numCols = data->readout->image->numCols;
    443444    *numRows = data->readout->image->numRows;
    444     if (data->readout->weight) {
     445    if (data->readout->variance) {
    445446        *haveVariances = true;
    446         PS_ASSERT_IMAGE_NON_NULL(data->readout->weight, false);
    447         PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->weight, false);
    448         PS_ASSERT_IMAGE_TYPE(data->readout->weight, PS_TYPE_F32, false);
     447        PS_ASSERT_IMAGE_NON_NULL(data->readout->variance, false);
     448        PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->variance, false);
     449        PS_ASSERT_IMAGE_TYPE(data->readout->variance, PS_TYPE_F32, false);
    449450    }
    450451    *haveRejects = (data->reject != NULL);
     
    473474        PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->mask, false);
    474475        if (*haveVariances) {
    475             PS_ASSERT_IMAGE_NON_NULL(data->readout->weight, false);
    476             PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->weight, false);
    477             PS_ASSERT_IMAGE_TYPE(data->readout->weight, PS_TYPE_F32, false);
     476            PS_ASSERT_IMAGE_NON_NULL(data->readout->variance, false);
     477            PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->variance, false);
     478            PS_ASSERT_IMAGE_TYPE(data->readout->variance, PS_TYPE_F32, false);
    478479        }
    479480    }
     
    606607        weights->data.F32[i] = data->weight;
    607608        stack->data[i] = psMemIncrRefCounter(data->readout);
    608         // Variance factor
    609         float vf = psMetadataLookupF32(NULL, data->readout->parent->concepts, "CELL.VARFACTOR"); // Var factor
    610         if (!isfinite(vf)) {
    611             psWarning("Non-finite CELL.VARFACTOR for image %d --- setting to unity.", i);
    612             vf = 1.0;
    613         }
    614         varFactors->data.F32[i] = vf;
     609        varFactors->data.F32[i] = data->readout->covariance ?
     610            psImageCovarianceFactor(data->readout->covariance) : 1.0;
     611#if 0
    615612        if (isfinite(data->addVariance)) {
    616613            varFactors->data.F32[i] *= data->addVariance;
    617614        }
     615#endif
    618616        if (!haveRejects && !data->inspect) {
    619617            data->inspect = psPixelsAllocEmpty(PIXEL_LIST_BUFFER);
     
    649647        psImage *combinedImage = combined->image; // Combined image
    650648        psImage *combinedMask = combined->mask; // Combined mask
    651         psImage *combinedVariance = combined->weight; // Combined variance map
     649        psImage *combinedVariance = combined->variance; // Combined variance map
    652650
    653651        psArray *pixelMap = pixelMapGenerate(input, minInputCols, maxInputCols,
     
    702700        }
    703701
    704         psImage *combinedVariance = combined->weight; // Combined variance map
     702        psImage *combinedVariance = combined->variance; // Combined variance map
    705703        if (haveVariances && !combinedVariance) {
    706             combined->weight = psImageAlloc(numCols, numRows, PS_TYPE_F32);
    707             combinedVariance = combined->weight;
     704            combined->variance = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     705            combinedVariance = combined->variance;
    708706        }
    709707
Note: See TracChangeset for help on using the changeset viewer.