Changeset 21183 for trunk/psModules/src/imcombine/pmStack.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmStack.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmStack.c
r20712 r21183 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $11 * @date $Date: 200 8-11-13 03:50:30$10 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2009-01-27 06:39:38 $ 12 12 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii 13 13 * … … 63 63 64 64 buffer->pixels = psVectorAlloc(numImages, PS_TYPE_F32); 65 buffer->masks = psVectorAlloc(numImages, PS_TYPE_ MASK);65 buffer->masks = psVectorAlloc(numImages, PS_TYPE_VECTOR_MASK); 66 66 buffer->variances = psVectorAlloc(numImages, PS_TYPE_F32); 67 67 buffer->weights = psVectorAlloc(numImages, PS_TYPE_F32); … … 143 143 assert(!masks || values->n == masks->n); 144 144 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); 146 146 assert(sortBuffer && sortBuffer->nalloc >= values->n && sortBuffer->type.type == PS_TYPE_F32); 147 147 … … 149 149 int num = 0; // Number of valid values 150 150 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]) { 152 152 sortBuffer->data.F32[num++] = values->data.F32[i]; 153 153 } … … 215 215 const psVector *reject, // Indices of pixels to reject, or NULL 216 216 int x, int y, // Coordinates of interest; frame of output image 217 ps MaskType maskVal, // Value to mask218 ps MaskType bad, // Value to give bad pixels217 psImageMaskType maskVal, // Value to mask 218 psImageMaskType bad, // Value to give bad pixels 219 219 int numIter, // Number of rejection iterations 220 220 float rej, // Number of standard deviations at which to reject … … 258 258 int xIn = x - data->readout->col0, yIn = y - data->readout->row0; // Coordinates on input readout 259 259 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) { 261 261 continue; 262 262 } … … 283 283 // Default option is that the pixel is bad 284 284 float imageValue = NAN, varianceValue = NAN; // Value for combined image and variance map 285 ps MaskType maskValue = bad; // Value for combined mask285 psImageMaskType maskValue = bad; // Value for combined mask 286 286 switch (num) { 287 287 case 0: … … 382 382 // Mask a pixel for inspection 383 383 #define MASK_PIXEL_FOR_INSPECTION() \ 384 pixelMasks->data.PS_TYPE_ MASK_DATA[j] = 0xff; \384 pixelMasks->data.PS_TYPE_VECTOR_MASK_DATA[j] = 0xff; \ 385 385 combineInspect(inputs, x, y, pixelSources->data.U16[j]); \ 386 386 numClipped++; \ … … 388 388 389 389 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]) { 391 391 continue; 392 392 } … … 408 408 409 409 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; 411 411 if (variance) { 412 412 variance->data.F32[y][x] = varianceValue; … … 438 438 PS_ASSERT_IMAGE_TYPE(data->readout->image, PS_TYPE_F32, false); 439 439 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); 441 441 PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->mask, false); 442 442 *numCols = data->readout->image->numCols; … … 469 469 PS_ASSERT_IMAGE_NON_NULL(data->readout->mask, false); 470 470 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); 472 472 PS_ASSERT_IMAGE_SIZE(data->readout->image, *numCols, *numRows, false); 473 473 PS_ASSERT_IMAGES_SIZE_EQUAL(data->readout->image, data->readout->mask, false); … … 562 562 563 563 /// Stack input images 564 bool pmStackCombine(pmReadout *combined, psArray *input, ps MaskType maskVal, psMaskType bad,564 bool pmStackCombine(pmReadout *combined, psArray *input, psImageMaskType maskVal, psImageMaskType bad, 565 565 int kernelSize, int numIter, float rej, float sys, 566 566 bool entire, bool useVariance, bool safe) … … 587 587 PS_ASSERT_IMAGE_TYPE(combined->image, PS_TYPE_F32, false); 588 588 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); 590 590 PS_ASSERT_IMAGES_SIZE_EQUAL(combined->image, combined->mask, false); 591 591 } … … 698 698 psImage *combinedMask = combined->mask; // Combined mask 699 699 if (!combinedMask) { 700 combined->mask = psImageAlloc(numCols, numRows, PS_TYPE_ MASK);700 combined->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 701 701 combinedMask = combined->mask; 702 702 }
Note:
See TracChangeset
for help on using the changeset viewer.
