IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 2, 2009, 5:08:31 PM (17 years ago)
Author:
Paul Price
Message:

Serious rework of pmStackCombine for clarity and some additional functionality. Split the combinePixels function into two operating modes (test and combine) to make clear what we're doing; pmStackCombine could be split into two separate functions (e.g., pmStackTest and pmStackCombine) in the future, since the testing part doesn't need to produce any output image, but this involves moving a lot of stuff around in ppStack, so not doing it yet. Verified that variance scaling is correct, and softening of variance is correct. Big improvement in minimising loss of good pixels comes from throwing out only the most variant pixel on each rejection pass (consequently changed iterations parameter to iterations per input); this involved another rework of the core combinePixels function (moving the switch on the number of valid inputs inside the iteration). Much happier with the outlier rejection now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap/ppStack/src/ppStackConvolve.c

    r25955 r26007  
    99#include "ppStack.h"
    1010#include "ppStackLoop.h"
     11
     12//#define TESTING
     13
    1114
    1215// Update the value of a concept
     
    130133        ppStackWriteImage(options->convMasks->data[i], maskHeader, readout->mask, config);
    131134        psFree(maskHeader);
    132         psImageCovarianceTransfer(readout->variance, readout->covariance);
    133135        ppStackWriteImage(options->convVariances->data[i], hdu->header, readout->variance, config);
    134136#ifdef TESTING
     
    139141            pmStackVisualPlotTestImage(readout->covariance->image, name);
    140142            psFree(name);
     143        }
     144        {
     145            int numCols = readout->image->numCols, numRows = readout->image->numRows;
     146            psImage *sn = psImageAlloc(numCols, numRows, PS_TYPE_F32);
     147            for (int y = 0; y < numRows; y++) {
     148                for (int x = 0; x < numCols; x++) {
     149                    sn->data.F32[y][x] = readout->image->data.F32[y][x] /
     150                        sqrtf(readout->variance->data.F32[y][x]);
     151                }
     152            }
     153            psString name = NULL;
     154            psStringAppend(&name, "signoise_%d.fits", i);
     155            ppStackWriteImage(name, hdu->header, sn, config);
     156            psFree(name);
     157            psFree(sn);
    141158        }
    142159#endif
     
    221238            numGood = 0;                    // Number of good images
    222239            for (int i = 0; i < num; i++) {
    223               if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
     240                if (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
    224241                    continue;
    225242                }
     
    245262    // Correct chi^2 for renormalisation
    246263    psBinaryOp(options->matchChi2, options->matchChi2, "/", renorms);
     264    for (int i = 0; i < num; i++) {
     265        psLogMsg("ppStack", PS_LOG_INFO, "Additional variance for image %d: %f\n",
     266                 i, options->matchChi2->data.F32[i]);
     267    }
    247268    psFree(renorms);
    248269
Note: See TracChangeset for help on using the changeset viewer.