IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

File:
1 edited

Legend:

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

    r20712 r21183  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2008-11-13 03:50:30 $
     10 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2009-01-27 06:39:38 $
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
    1313 *
     
    6363
    6464    buffer->pixels = psVectorAlloc(numImages, PS_TYPE_F32);
    65     buffer->masks = psVectorAlloc(numImages, PS_TYPE_MASK);
     65    buffer->masks = psVectorAlloc(numImages, PS_TYPE_VECTOR_MASK);
    6666    buffer->variances = psVectorAlloc(numImages, PS_TYPE_F32);
    6767    buffer->weights = psVectorAlloc(numImages, PS_TYPE_F32);
     
    143143    assert(!masks || values->n == masks->n);
    144144    assert(values->type.type == PS_TYPE_F32);
    145     assert(!masks || masks->type.type == PS_TYPE_MASK);
     145    assert(!masks || masks->type.type == PS_TYPE_VECTOR_MASK);
    146146    assert(sortBuffer && sortBuffer->nalloc >= values->n && sortBuffer->type.type == PS_TYPE_F32);
    147147
     
    149149    int num = 0;            // Number of valid values
    150150    for (int i = 0; i < values->n; i++) {
    151         if (!masks || !masks->data.PS_TYPE_MASK_DATA[i]) {
     151        if (!masks || !masks->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    152152            sortBuffer->data.F32[num++] = values->data.F32[i];
    153153        }
     
    215215                          const psVector *reject, // Indices of pixels to reject, or NULL
    216216                          int x, int y, // Coordinates of interest; frame of output image
    217                           psMaskType maskVal, // Value to mask
    218                           psMaskType bad, // Value to give bad pixels
     217                          psImageMaskType maskVal, // Value to mask
     218                          psImageMaskType bad, // Value to give bad pixels
    219219                          int numIter, // Number of rejection iterations
    220220                          float rej, // Number of standard deviations at which to reject
     
    258258        int xIn = x - data->readout->col0, yIn = y - data->readout->row0; // Coordinates on input readout
    259259        psImage *mask = data->readout->mask; // Mask of interest
    260         if (mask->data.PS_TYPE_MASK_DATA[yIn][xIn] & maskVal) {
     260        if (mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & maskVal) {
    261261            continue;
    262262        }
     
    283283    // Default option is that the pixel is bad
    284284    float imageValue = NAN, varianceValue = NAN; // Value for combined image and variance map
    285     psMaskType maskValue = bad;         // Value for combined mask
     285    psImageMaskType maskValue = bad;         // Value for combined mask
    286286    switch (num) {
    287287      case 0:
     
    382382// Mask a pixel for inspection
    383383#define MASK_PIXEL_FOR_INSPECTION() \
    384     pixelMasks->data.PS_TYPE_MASK_DATA[j] = 0xff; \
     384    pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xff; \
    385385    combineInspect(inputs, x, y, pixelSources->data.U16[j]); \
    386386    numClipped++; \
     
    388388
    389389              for (int j = 0; j < num; j++) {
    390                   if (pixelMasks->data.PS_TYPE_MASK_DATA[j]) {
     390                  if (pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[j]) {
    391391                      continue;
    392392                  }
     
    408408
    409409    image->data.F32[y][x] = imageValue;
    410     mask->data.PS_TYPE_MASK_DATA[y][x] = maskValue;
     410    mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] = maskValue;
    411411    if (variance) {
    412412        variance->data.F32[y][x] = varianceValue;
     
    438438    PS_ASSERT_IMAGE_TYPE(data->readout->image, PS_TYPE_F32, false);
    439439    PS_ASSERT_IMAGE_NON_NULL(data->readout->mask, false);
    440     PS_ASSERT_IMAGE_TYPE(data->readout->mask, PS_TYPE_MASK, false);
     440    PS_ASSERT_IMAGE_TYPE(data->readout->mask, PS_TYPE_IMAGE_MASK, false);
    441441    PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->mask, false);
    442442    *numCols = data->readout->image->numCols;
     
    469469        PS_ASSERT_IMAGE_NON_NULL(data->readout->mask, false);
    470470        PS_ASSERT_IMAGE_TYPE(data->readout->image, PS_TYPE_F32, false);
    471         PS_ASSERT_IMAGE_TYPE(data->readout->mask, PS_TYPE_MASK, false);
     471        PS_ASSERT_IMAGE_TYPE(data->readout->mask, PS_TYPE_IMAGE_MASK, false);
    472472        PS_ASSERT_IMAGE_SIZE(data->readout->image, *numCols, *numRows, false);
    473473        PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->mask, false);
     
    562562
    563563/// Stack input images
    564 bool pmStackCombine(pmReadout *combined, psArray *input, psMaskType maskVal, psMaskType bad,
     564bool pmStackCombine(pmReadout *combined, psArray *input, psImageMaskType maskVal, psImageMaskType bad,
    565565                    int kernelSize, int numIter, float rej, float sys,
    566566                    bool entire, bool useVariance, bool safe)
     
    587587        PS_ASSERT_IMAGE_TYPE(combined->image, PS_TYPE_F32, false);
    588588        PS_ASSERT_IMAGE_NON_NULL(combined->mask, false);
    589         PS_ASSERT_IMAGE_TYPE(combined->mask, PS_TYPE_MASK, false);
     589        PS_ASSERT_IMAGE_TYPE(combined->mask, PS_TYPE_IMAGE_MASK, false);
    590590        PS_ASSERT_IMAGES_SIZE_EQUAL(combined->image, combined->mask, false);
    591591    }
     
    698698        psImage *combinedMask = combined->mask; // Combined mask
    699699        if (!combinedMask) {
    700             combined->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     700            combined->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK);
    701701            combinedMask = combined->mask;
    702702        }
Note: See TracChangeset for help on using the changeset viewer.