Changeset 21075
- Timestamp:
- Dec 31, 2008, 10:31:29 AM (17 years ago)
- Location:
- branches/eam_branch_20081230/psModules/src
- Files:
-
- 18 edited
-
detrend/pmShutterCorrection.c (modified) (19 diffs)
-
imcombine/pmReadoutCombine.c (modified) (6 diffs)
-
imcombine/pmReadoutCombine.h (modified) (2 diffs)
-
imcombine/pmStack.c (modified) (15 diffs)
-
imcombine/pmSubtraction.c (modified) (17 diffs)
-
imcombine/pmSubtractionMask.c (modified) (8 diffs)
-
imcombine/pmSubtractionMatch.c (modified) (4 diffs)
-
imcombine/pmSubtractionStamps.c (modified) (6 diffs)
-
objects/pmFootprintFindAtPoint.c (modified) (7 diffs)
-
objects/pmGrowthCurveGenerate.c (modified) (6 diffs)
-
objects/pmModel.c (modified) (9 diffs)
-
objects/pmPSFtry.c (modified) (20 diffs)
-
objects/pmSource.c (modified) (8 diffs)
-
objects/pmSourceFitModel.c (modified) (9 diffs)
-
objects/pmSourceFitSet.c (modified) (9 diffs)
-
objects/pmSourcePhotometry.c (modified) (14 diffs)
-
objects/pmSourceSky.c (modified) (5 diffs)
-
objects/pmTrend2D.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20081230/psModules/src/detrend/pmShutterCorrection.c
r21072 r21075 198 198 pmShutterCorrection *pmShutterCorrectionLinFit(const psVector *exptime, const psVector *counts, 199 199 const psVector *cntError, const psVector *mask, float offref, 200 int nIter, float rej , psMaskType maskVal)200 int nIter, float rej) 201 201 { 202 202 PS_ASSERT_VECTOR_NON_NULL(exptime, NULL); … … 241 241 stats->clipIter = nIter; 242 242 243 if (!psVectorClipFitPolynomial2D(line, stats, mask, maskVal, counts, cntError, x, y)) {243 if (!psVectorClipFitPolynomial2D(line, stats, mask, 0xff, counts, cntError, x, y)) { 244 244 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to fit shutter correction.\n"); 245 245 psFree(stats); … … 371 371 372 372 bool pmShutterCorrectionMeasure(pmReadout *output, const psArray *readouts, int size, psStatsOptions meanStat, 373 psStatsOptions stdevStat, int nIter, float rej, ps MaskType maskVal)373 psStatsOptions stdevStat, int nIter, float rej, psImageMaskType maskVal) 374 374 { 375 375 PS_ASSERT_ARRAY_NON_NULL(readouts, NULL); … … 457 457 masks->data[i] = psMemIncrRefCounter(mask); 458 458 459 if (mask->type.type != PS_TYPE_ U8) {459 if (mask->type.type != PS_TYPE_IMAGE_MASK) { 460 460 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Bad type for mask: %x\n", mask->type.type); 461 461 goto MEASURE_ERROR; … … 582 582 psImage *shutter = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Shutter correction image 583 583 psImage *pattern = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Illumination pattern 584 psVector *mask = psVectorAlloc(num, PS_TYPE_ U8); // Mask for each image584 psVector *mask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for each image 585 585 psVectorInit(mask, 0); 586 586 psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n"); … … 592 592 psImage *maskImage; // Mask image 593 593 if (masks && (maskImage = masks->data[i])) { 594 mask->data. U8[i] = maskImage->data.U8[y][x];594 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (maskImage->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskVal); 595 595 } 596 596 psImage *weight; // Weight image … … 602 602 } 603 603 604 pmShutterCorrection *corr = pmShutterCorrectionLinFit(exptimes, counts, errors, mask, meanRef, 605 nIter, rej, maskVal); 604 pmShutterCorrection *corr = pmShutterCorrectionLinFit(exptimes, counts, errors, mask, meanRef, nIter, rej); 606 605 shutter->data.F32[y][x] = corr->offset; 607 606 pattern->data.F32[y][x] = corr->scale; … … 665 664 666 665 float exptime = PS_SCALAR_VALUE(job->args->data[3],F32); 667 ps MaskType blank = PS_SCALAR_VALUE(job->args->data[4],U8);666 psImageMaskType blank = PS_SCALAR_VALUE(job->args->data[4],PS_TYPE_IMAGE_MASK_DATA); 668 667 int rowStart = PS_SCALAR_VALUE(job->args->data[5],S32); 669 668 int rowStop = PS_SCALAR_VALUE(job->args->data[6],S32); … … 672 671 673 672 bool pmShutterCorrectionApplyScan(psImage *image, const psImage *shutterImage, psImage *mask, float exptime, 674 ps MaskType blank, int rowStart, int rowStop)673 psImageMaskType blank, int rowStart, int rowStop) 675 674 { 676 675 for (int y = rowStart; y < rowStop; y++) { 677 676 for (int x = 0; x < image->numCols; x++) { 678 677 if (mask && !isfinite(shutterImage->data.F32[y][x])) { 679 mask->data.PS_TYPE_ MASK_DATA[y][x] |= blank;678 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= blank; 680 679 image->data.F32[y][x] = NAN; 681 680 continue; … … 687 686 } 688 687 689 bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter, ps MaskType blank)688 bool pmShutterCorrectionApply(pmReadout *readout, const pmReadout *shutter, psImageMaskType blank) 690 689 { 691 690 PS_ASSERT_PTR_NON_NULL(readout, false); … … 746 745 for (int x = 0; x < image->numCols; x++) { 747 746 if (mask && !isfinite(shutterImage->data.F32[y][x])) { 748 mask->data.PS_TYPE_ MASK_DATA[y][x] |= blank;747 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= blank; 749 748 image->data.F32[y][x] = NAN; 750 749 continue; … … 770 769 psArrayAdd(job->args, 1, mask); 771 770 PS_ARRAY_ADD_SCALAR(job->args, exptime, PS_TYPE_F32); 772 PS_ARRAY_ADD_SCALAR(job->args, blank, PS_TYPE_ MASK);771 PS_ARRAY_ADD_SCALAR(job->args, blank, PS_TYPE_IMAGE_MASK); 773 772 PS_ARRAY_ADD_SCALAR(job->args, rowStart, PS_TYPE_S32); 774 773 PS_ARRAY_ADD_SCALAR(job->args, rowStop, PS_TYPE_S32); … … 860 859 psStatsOptions meanStat, ///< Statistic to use for mean 861 860 psStatsOptions stdevStat, ///< Statistic to use for stdev 862 ps MaskType maskVal, ///< Mask value861 psImageMaskType maskVal, ///< Mask value 863 862 psRandom *rng ///< Random number generator 864 863 ) … … 876 875 if (readout->mask) { 877 876 PS_ASSERT_IMAGE_NON_NULL(readout->mask, NULL); 878 PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_ MASK, NULL);877 PS_ASSERT_IMAGE_TYPE(readout->mask, PS_TYPE_IMAGE_MASK, NULL); 879 878 PS_ASSERT_IMAGE_SIZE(readout->mask, data->numCols, data->numRows, NULL); 880 879 } … … 1022 1021 1023 1022 bool pmShutterCorrectionGeneratePrepare(pmReadout *shutter, pmReadout *pattern, const psArray *inputs, 1024 ps MaskType maskVal)1023 psImageMaskType maskVal) 1025 1024 { 1026 1025 PS_ASSERT_PTR_NON_NULL(shutter, false); … … 1084 1083 bool pmShutterCorrectionGenerate(pmReadout *shutter, pmReadout *pattern, const psArray *inputs, 1085 1084 float reference, const pmShutterCorrectionData *data, 1086 int nIter, float rej, ps MaskType maskVal)1085 int nIter, float rej, psImageMaskType maskVal) 1087 1086 { 1088 1087 PS_ASSERT_PTR_NON_NULL(shutter, false); … … 1116 1115 psVector *counts = psVectorAlloc(num, PS_TYPE_F32); // Counts in each image 1117 1116 psVector *errors = psVectorAlloc(num, PS_TYPE_F32); // Counts in each image 1118 psVector *mask = psVectorAlloc(num, PS_TYPE_ MASK); // Mask for each image1117 psVector *mask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for each image 1119 1118 psTrace("psModules.detrend", 2, "Performing linear fit on individual pixels...\n"); 1120 1119 for (int i = minInputRows; i < maxInputRows; i++) { … … 1132 1131 counts->data.F32[r] = image->data.F32[yIn][xIn] * ref; 1133 1132 if (readout->mask) { 1134 mask->data.PS_TYPE_ MASK_DATA[r] = readout->mask->data.PS_TYPE_MASK_DATA[yIn][xIn];1133 mask->data.PS_TYPE_VECTOR_MASK_DATA[r] = (readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & maskVal); 1135 1134 } 1136 1135 if (readout->weight) { … … 1142 1141 } 1143 1142 1144 pmShutterCorrection *corr = pmShutterCorrectionLinFit(data->exptimes, counts, errors, mask, 1145 reference, nIter, rej, maskVal); 1143 pmShutterCorrection *corr = pmShutterCorrectionLinFit(data->exptimes, counts, errors, mask, reference, nIter, rej); 1146 1144 if (!corr) { 1147 1145 // Nothing we can do about it -
branches/eam_branch_20081230/psModules/src/imcombine/pmReadoutCombine.c
r19086 r21075 105 105 106 106 // note the mask value actually used 107 ps MaskType maskVal = params->maskVal; // The mask value107 psImageMaskType maskVal = params->maskVal; // The mask value 108 108 if (maskVal) { 109 109 psString comment = NULL; // Comment to add to header … … 247 247 psF32 *pixelsData = pixels->data.F32; // Dereference pixels 248 248 249 psVector *mask = psVectorAlloc(inputs->n, PS_TYPE_ U8); // Mask for stack250 ps U8 *maskData = mask->data.U8; // Dereference mask249 psVector *mask = psVectorAlloc(inputs->n, PS_TYPE_VECTOR_MASK); // Mask for stack 250 psVectorMaskType *maskData = mask->data.PS_TYPE_VECTOR_MASK_DATA; // Dereference mask 251 251 252 252 psVector *weights = NULL; // Stack of weights … … 260 260 261 261 float keepFrac = 1.0 - params->fracLow - params->fracHigh; // Fraction of pixels to keep 262 ps MaskType maskVal = params->maskVal; // The mask value262 psImageMaskType maskVal = params->maskVal; // The mask value 263 263 264 264 #ifndef PS_NO_TRACE … … 278 278 // Dereference output products 279 279 psF32 **outputImage = output->image->data.F32; // Output image 280 ps U8 **outputMask = output->mask->data.U8; // Output mask280 psImageMaskType **outputMask = output->mask->data.PS_TYPE_IMAGE_MASK_DATA; // Output mask 281 281 psF32 **outputWeight = NULL; // Output weight map 282 282 if (output->weight) { … … 303 303 304 304 int numValid = 0; // Number of valid pixels in the stack 305 memset(maskData, 0, mask->n * sizeof(ps U8)); // Reset the mask305 memset(maskData, 0, mask->n * sizeof(psImageMaskType)); // Reset the mask 306 306 for (int r = 0; r < inputs->n; r++) { 307 307 pmReadout *readout = inputs->data[r]; // Input readout … … 318 318 // Check mask 319 319 psImage *roMask = readout->mask; // The mask image 320 if (roMask && roMask->data. U8[yIn][xIn] & maskVal) {320 if (roMask && roMask->data.PS_TYPE_IMAGE_MASK_DATA[yIn][xIn] & maskVal) { 321 321 maskData[r] = 1; 322 322 continue; -
branches/eam_branch_20081230/psModules/src/imcombine/pmReadoutCombine.h
r21072 r21075 5 5 * @author Paul Price, IfA 6 6 * 7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $8 * @date $Date: 2008- 08-01 00:01:26$7 * @version $Revision: 1.14.24.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-12-31 20:31:28 $ 9 9 * Copyright 2004-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 22 22 typedef struct { 23 23 psStatsOptions combine; ///< Statistic to use when performing the combination 24 ps MaskType maskVal;///< Mask value25 ps MaskType blank;///< Mask value to give blank (i.e., no data) pixels24 psImageMaskType maskVal; ///< Mask value 25 psImageMaskType blank; ///< Mask value to give blank (i.e., no data) pixels 26 26 int nKeep; ///< Mimimum number of pixels to keep 27 27 float fracHigh; ///< Fraction of high pixels to immediately throw -
branches/eam_branch_20081230/psModules/src/imcombine/pmStack.c
r20712 r21075 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $11 * @date $Date: 2008-1 1-13 03:50:30$10 * @version $Revision: 1.45.6.1 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2008-12-31 20:31:28 $ 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 } -
branches/eam_branch_20081230/psModules/src/imcombine/pmSubtraction.c
r20838 r21075 246 246 psImage *image, // Image to convolve 247 247 psImage *mask, // Mask image 248 ps MaskType maskVal, // Value to mask248 psImageMaskType maskVal, // Value to mask 249 249 const psKernel *kernel, // Kernel by which to convolve 250 250 psRegion region,// Region of interest … … 291 291 psImage *sys, // Systematic error image 292 292 psImage *mask, // Mask image 293 ps MaskType maskVal, // Value to mask293 psImageMaskType maskVal, // Value to mask 294 294 const psKernel *kernel, // Kernel by which to convolve 295 295 psRegion region,// Region of interest … … 373 373 float background, // Background value to apply 374 374 psRegion region, // Region to convolve 375 ps MaskType maskBad, // Value to give bad pixels376 ps MaskType maskPoor, // Value to give poor pixels375 psImageMaskType maskBad, // Value to give bad pixels 376 psImageMaskType maskPoor, // Value to give poor pixels 377 377 float poorFrac, // Fraction for "poor" 378 378 bool useFFT, // Use FFT to convolve? … … 385 385 } 386 386 387 ps MaskType subBad; // Bad pixels in subtraction mask388 ps MaskType subConvBad; // Bad pixels in subtraction mask when convolving389 ps MaskType subConvPoor; // Poor pixels in subtraction mask when convolving387 psImageMaskType subBad; // Bad pixels in subtraction mask 388 psImageMaskType subConvBad; // Bad pixels in subtraction mask when convolving 389 psImageMaskType subConvPoor; // Poor pixels in subtraction mask when convolving 390 390 if (kernels->mode == PM_SUBTRACTION_MODE_1 || (kernels->mode == PM_SUBTRACTION_MODE_DUAL && !wantDual)) { 391 391 subBad = PM_SUBTRACTION_MASK_BAD_1; … … 437 437 for (int yTarget = rowMin, ySource = box; yTarget < rowMax; yTarget++, ySource++) { 438 438 // Dereference images 439 ps MaskType *target = &convMask->data.PS_TYPE_MASK_DATA[yTarget][colMin]; // Target values440 ps MaskType *source = &convolved->data.PS_TYPE_MASK_DATA[ySource][box]; // Source values439 psImageMaskType *target = &convMask->data.PS_TYPE_IMAGE_MASK_DATA[yTarget][colMin]; // Target values 440 psImageMaskType *source = &convolved->data.PS_TYPE_IMAGE_MASK_DATA[ySource][box]; // Source values 441 441 for (int xTarget = colMin; xTarget < colMax; xTarget++, target++, source++) { 442 442 if (*source & subConvBad) { … … 783 783 PS_ASSERT_VECTOR_TYPE(deviations, PS_TYPE_F32, -1); 784 784 PS_ASSERT_IMAGE_NON_EMPTY(subMask, -1); 785 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_ MASK, -1);785 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_IMAGE_MASK, -1); 786 786 787 787 // I used to measure the rms deviation about zero, and use that as the sigma against which to clip, but … … 794 794 795 795 int numStamps = 0; // Number of used stamps 796 psVector *mask = psVectorAlloc(stamps->num, PS_TYPE_ MASK); // Mask, for statistics796 psVector *mask = psVectorAlloc(stamps->num, PS_TYPE_VECTOR_MASK); // Mask, for statistics 797 797 psVectorInit(mask, 0); 798 798 for (int i = 0; i < stamps->num; i++) { 799 799 pmSubtractionStamp *stamp = stamps->stamps->data[i]; // Stamp of interest 800 800 if (stamp->status != PM_SUBTRACTION_STAMP_USED) { 801 mask->data.PS_TYPE_ MASK_DATA[i] = 0xff;801 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xff; 802 802 continue; 803 803 } … … 869 869 for (int y = stamp->y - footprint; y <= stamp->y + footprint; y++) { 870 870 for (int x = stamp->x - footprint; x <= stamp->x + footprint; x++) { 871 subMask->data.PS_TYPE_ MASK_DATA[y][x] |= PM_SUBTRACTION_MASK_REJ;871 subMask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= PM_SUBTRACTION_MASK_REJ; 872 872 } 873 873 } … … 997 997 psImage *sys1, psImage *sys2, // Systematic error images 998 998 psImage *subMask, // Input subtraction mask 999 ps MaskType maskBad, // Mask value to give bad pixels1000 ps MaskType maskPoor, // Mask value to give poor pixels999 psImageMaskType maskBad, // Mask value to give bad pixels 1000 psImageMaskType maskPoor, // Mask value to give poor pixels 1001 1001 float poorFrac, // Fraction for "poor" 1002 1002 const psRegion *region, // Patch to convolve … … 1035 1035 1036 1036 if ((kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) && ro1->mask) { 1037 ps MaskType **target = convMask->data.PS_TYPE_MASK_DATA; // Target mask1038 ps MaskType **source = ro1->mask->data.PS_TYPE_MASK_DATA; // Source mask1037 psImageMaskType **target = convMask->data.PS_TYPE_IMAGE_MASK_DATA; // Target mask 1038 psImageMaskType **source = ro1->mask->data.PS_TYPE_IMAGE_MASK_DATA; // Source mask 1039 1039 1040 1040 for (int y = yMin; y < yMax; y++) { … … 1045 1045 } 1046 1046 if ((kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) && ro2->mask) { 1047 ps MaskType **target = convMask->data.PS_TYPE_MASK_DATA; // Target mask1048 ps MaskType **source = ro2->mask->data.PS_TYPE_MASK_DATA; // Source mask1047 psImageMaskType **target = convMask->data.PS_TYPE_IMAGE_MASK_DATA; // Target mask 1048 psImageMaskType **source = ro2->mask->data.PS_TYPE_IMAGE_MASK_DATA; // Source mask 1049 1049 1050 1050 for (int y = yMin; y < yMax; y++) { … … 1075 1075 psImage *sys2 = args->data[10]; // Systematic error image 2 1076 1076 psImage *subMask = args->data[11]; // Subtraction mask 1077 ps MaskType maskBad = PS_SCALAR_VALUE(args->data[12], U8); // Output mask value for bad pixels1078 ps MaskType maskPoor = PS_SCALAR_VALUE(args->data[13], U8); // Output mask value for poor pixels1077 psImageMaskType maskBad = PS_SCALAR_VALUE(args->data[12], PS_TYPE_IMAGE_MASK_DATA); // Output mask value for bad pixels 1078 psImageMaskType maskPoor = PS_SCALAR_VALUE(args->data[13], PS_TYPE_IMAGE_MASK_DATA); // Output mask value for poor pixels 1079 1079 float poorFrac = PS_SCALAR_VALUE(args->data[14], F32); // Fraction for "poor" 1080 1080 const psRegion *region = args->data[15]; // Region to convolve 1081 1081 const pmSubtractionKernels *kernels = args->data[16]; // Kernels 1082 bool doBG = PS_SCALAR_VALUE(args->data[17], U8); // Do background subtraction?1083 bool useFFT = PS_SCALAR_VALUE(args->data[18], U8); // Use FFT for convolution?1082 bool doBG = PS_SCALAR_VALUE(args->data[17], PS_TYPE_IMAGE_MASK_DATA); // Do background subtraction? 1083 bool useFFT = PS_SCALAR_VALUE(args->data[18], PS_TYPE_IMAGE_MASK_DATA); // Use FFT for convolution? 1084 1084 1085 1085 return subtractionConvolvePatch(numCols, numRows, x0, y0, out1, out2, convMask, ro1, ro2, sys1, sys2, … … 1088 1088 1089 1089 bool pmSubtractionConvolve(pmReadout *out1, pmReadout *out2, const pmReadout *ro1, const pmReadout *ro2, 1090 psImage *subMask, int stride, ps MaskType maskBad, psMaskType maskPoor,1090 psImage *subMask, int stride, psImageMaskType maskBad, psImageMaskType maskPoor, 1091 1091 float poorFrac, float sysError, const psRegion *region, 1092 1092 const pmSubtractionKernels *kernels, bool doBG, bool useFFT) … … 1121 1121 if (subMask) { 1122 1122 PS_ASSERT_IMAGE_NON_NULL(subMask, false); 1123 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_ MASK, false);1123 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_IMAGE_MASK, false); 1124 1124 PS_ASSERT_IMAGE_SIZE(subMask, numCols, numRows, false); 1125 1125 } … … 1182 1182 if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) { 1183 1183 if (!out1->mask) { 1184 out1->mask = psImageAlloc(numCols, numRows, PS_TYPE_ MASK);1184 out1->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 1185 1185 } 1186 1186 convMask = out1->mask; … … 1194 1194 } else { 1195 1195 if (!out2->mask) { 1196 out2->mask = psImageAlloc(numCols, numRows, PS_TYPE_ MASK);1196 out2->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 1197 1197 } 1198 1198 convMask = out2->mask; … … 1285 1285 psMutexUnlock(subMask); 1286 1286 } 1287 PS_ARRAY_ADD_SCALAR(args, maskBad, PS_TYPE_ U8);1288 PS_ARRAY_ADD_SCALAR(args, maskPoor, PS_TYPE_ U8);1287 PS_ARRAY_ADD_SCALAR(args, maskBad, PS_TYPE_IMAGE_MASK); 1288 PS_ARRAY_ADD_SCALAR(args, maskPoor, PS_TYPE_IMAGE_MASK); 1289 1289 PS_ARRAY_ADD_SCALAR(args, poorFrac, PS_TYPE_F32); 1290 1290 psArrayAdd(args, 1, subRegion); -
branches/eam_branch_20081230/psModules/src/imcombine/pmSubtractionMask.c
r20832 r21075 20 20 psImage *weight, // Weight map to mark as blank (or NULL) 21 21 int x, int y, // Coordinates to mark blank 22 ps MaskType blank // Blank mask value22 psImageMaskType blank // Blank mask value 23 23 ) 24 24 { 25 25 image->data.F32[y][x] = NAN; 26 26 if (mask) { 27 mask->data.PS_TYPE_ MASK_DATA[y][x] |= blank;27 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= blank; 28 28 } 29 29 if (weight) { … … 37 37 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 38 38 39 psImage *pmSubtractionMask(const psImage *mask1, const psImage *mask2, ps MaskType maskVal,39 psImage *pmSubtractionMask(const psImage *mask1, const psImage *mask2, psImageMaskType maskVal, 40 40 int size, int footprint, float badFrac, bool useFFT) 41 41 { 42 42 PS_ASSERT_IMAGE_NON_NULL(mask1, NULL); 43 PS_ASSERT_IMAGE_TYPE(mask1, PS_TYPE_ MASK, NULL);43 PS_ASSERT_IMAGE_TYPE(mask1, PS_TYPE_IMAGE_MASK, NULL); 44 44 if (mask2) { 45 45 PS_ASSERT_IMAGE_NON_NULL(mask2, NULL); 46 PS_ASSERT_IMAGE_TYPE(mask2, PS_TYPE_ MASK, NULL);46 PS_ASSERT_IMAGE_TYPE(mask2, PS_TYPE_IMAGE_MASK, NULL); 47 47 PS_ASSERT_IMAGES_SIZE_EQUAL(mask2, mask1, NULL); 48 48 } … … 57 57 58 58 // Dereference inputs for convenience 59 ps MaskType **data1 = mask1->data.PS_TYPE_MASK_DATA;60 ps MaskType **data2 = NULL;59 psImageMaskType **data1 = mask1->data.PS_TYPE_IMAGE_MASK_DATA; 60 psImageMaskType **data2 = NULL; 61 61 if (mask2) { 62 data2 = mask2->data.PS_TYPE_ MASK_DATA;62 data2 = mask2->data.PS_TYPE_IMAGE_MASK_DATA; 63 63 } 64 64 … … 86 86 87 87 // Worried about the masks for bad pixels and bad stamps colliding, so make our own mask 88 psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_ MASK); // The global mask88 psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); // The global mask 89 89 psImageInit(mask, 0); 90 ps MaskType **maskData = mask->data.PS_TYPE_MASK_DATA; // Dereference for convenience90 psImageMaskType **maskData = mask->data.PS_TYPE_IMAGE_MASK_DATA; // Dereference for convenience 91 91 92 92 // Block out a border around the edge of the image … … 161 161 162 162 bool pmSubtractionBorder(psImage *image, psImage *weight, psImage *mask, 163 int size, ps MaskType blank)163 int size, psImageMaskType blank) 164 164 { 165 165 PS_ASSERT_IMAGE_NON_NULL(image, false); … … 168 168 PS_ASSERT_IMAGE_NON_NULL(mask, false); 169 169 PS_ASSERT_IMAGES_SIZE_EQUAL(mask, image, false); 170 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_ MASK, false);170 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_IMAGE_MASK, false); 171 171 } 172 172 if (weight) { … … 211 211 } 212 212 PS_ASSERT_IMAGE_NON_NULL(mask, false); 213 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_ MASK, false);213 PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_IMAGE_MASK, false); 214 214 PS_ASSERT_IMAGES_SIZE_EQUAL(mask, image, false); 215 215 … … 233 233 234 234 int numCols = image->numCols, numRows = image->numRows; // Size of image 235 ps MaskType **maskData = mask->data.PS_TYPE_MASK_DATA; // Dereference mask235 psImageMaskType **maskData = mask->data.PS_TYPE_IMAGE_MASK_DATA; // Dereference mask 236 236 237 237 for (int y = 0; y < numRows; y++) { -
branches/eam_branch_20081230/psModules/src/imcombine/pmSubtractionMatch.c
r20718 r21075 98 98 int inner, int ringsOrder, int binning, float penalty, 99 99 bool optimum, const psVector *optFWHMs, int optOrder, float optThreshold, 100 int iter, float rej, float sysError, ps MaskType maskVal, psMaskType maskBad,101 ps MaskType maskPoor, float poorFrac, float badFrac, pmSubtractionMode subMode)100 int iter, float rej, float sysError, psImageMaskType maskVal, psImageMaskType maskBad, 101 psImageMaskType maskPoor, float poorFrac, float badFrac, pmSubtractionMode subMode) 102 102 { 103 103 if (subMode != PM_SUBTRACTION_MODE_2) { … … 565 565 if (width1 == 0 || width2 == 0) { 566 566 ratios->data.F32[index] = NAN; 567 mask->data.PS_TYPE_ MASK_DATA[index] = 0xff;567 mask->data.PS_TYPE_IMAGE_MASK_DATA[index] = 0xff; 568 568 } else { 569 569 ratios->data.F32[index] = (float)width1 / (float)width2; 570 mask->data.PS_TYPE_ MASK_DATA[index] = 0;570 mask->data.PS_TYPE_IMAGE_MASK_DATA[index] = 0; 571 571 } 572 572 … … 594 594 PM_ASSERT_SUBTRACTION_STAMP_LIST_NON_NULL(stamps, PM_SUBTRACTION_MODE_ERR); 595 595 596 psVector *mask = psVectorAlloc(stamps->num, PS_TYPE_ MASK); // Mask for stamps596 psVector *mask = psVectorAlloc(stamps->num, PS_TYPE_IMAGE_MASK); // Mask for stamps 597 597 psVector *ratios = psVectorAlloc(stamps->num, PS_TYPE_F32); // Ratios of widths 598 598 … … 622 622 pmSubtractionStamp *stamp = stamps->stamps->data[i]; // Stamp of interest 623 623 if (stamp->status != PM_SUBTRACTION_STAMP_CALCULATE && stamp->status != PM_SUBTRACTION_STAMP_USED) { 624 mask->data.PS_TYPE_ MASK_DATA[i] = 0xff;624 mask->data.PS_TYPE_IMAGE_MASK_DATA[i] = 0xff; 625 625 continue; 626 626 } -
branches/eam_branch_20081230/psModules/src/imcombine/pmSubtractionStamps.c
r21072 r21075 98 98 99 99 // Determine mask value 100 ps MaskType maskVal = PM_SUBTRACTION_MASK_BORDER | PM_SUBTRACTION_MASK_BAD_1 | PM_SUBTRACTION_MASK_BAD_2;100 psImageMaskType maskVal = PM_SUBTRACTION_MASK_BORDER | PM_SUBTRACTION_MASK_BAD_1 | PM_SUBTRACTION_MASK_BAD_2; 101 101 switch (mode) { 102 102 case PM_SUBTRACTION_MODE_1: … … 115 115 116 116 // Check the immediate pixel 117 if (clean && (mask->data.PS_TYPE_ MASK_DATA[y][x] & (maskVal | PM_SUBTRACTION_MASK_REJ))) {117 if (clean && (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & (maskVal | PM_SUBTRACTION_MASK_REJ))) { 118 118 clean = false; 119 119 } … … 126 126 for (int j = yMin; j <= yMax; j++) { 127 127 for (int i = xMin; i <= xMax; i++) { 128 if (mask->data.PS_TYPE_ MASK_DATA[j][i] & maskVal) {128 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal) { 129 129 clean = false; 130 130 goto CHECK_STAMP_MASK_DONE; … … 139 139 for (int j = yMin; j <= yMax; j++) { 140 140 for (int i = xMin; i <= xMax; i++) { 141 mask->data.PS_TYPE_ MASK_DATA[j][i] |= PM_SUBTRACTION_MASK_REJ;141 mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= PM_SUBTRACTION_MASK_REJ; 142 142 } 143 143 } … … 235 235 PS_ASSERT_IMAGE_NON_NULL(subMask, NULL); 236 236 PS_ASSERT_IMAGES_SIZE_EQUAL(image, subMask, NULL); 237 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_ MASK, NULL);237 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_IMAGE_MASK, NULL); 238 238 } 239 239 PS_ASSERT_INT_NONNEGATIVE(footprint, NULL); … … 377 377 if (subMask) { 378 378 PS_ASSERT_IMAGE_NON_NULL(subMask, NULL); 379 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_ MASK, NULL);379 PS_ASSERT_IMAGE_TYPE(subMask, PS_TYPE_IMAGE_MASK, NULL); 380 380 if (image) { 381 381 PS_ASSERT_IMAGE_NON_NULL(image, NULL); -
branches/eam_branch_20081230/psModules/src/objects/pmFootprintFindAtPoint.c
r20937 r21075 4 4 * @author RHL, Princeton & IfA; EAM, IfA 5 5 * 6 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $7 * @date $Date: 2008-12- 08 02:51:14$6 * @version $Revision: 1.3.4.1 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-12-31 20:31:29 $ 8 8 * Copyright 2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 77 77 78 78 if (mask != NULL) { // remember that we've detected these pixels 79 ps MaskType *mpix = &mask->data.PS_TYPE_MASK_DATA[span->y - mask->row0][span->x0 - mask->col0];79 psImageMaskType *mpix = &mask->data.PS_TYPE_IMAGE_MASK_DATA[span->y - mask->row0][span->x0 - mask->col0]; 80 80 81 81 for (int i = 0; i <= span->x1 - span->x0; i++) { … … 143 143 psF32 *imgRowF32 = NULL; // row pointer if F32 144 144 psS32 *imgRowS32 = NULL; // " " " " !F32 145 ps MaskType *maskRow = NULL; // masks's row pointer145 psImageMaskType *maskRow = NULL; // masks's row pointer 146 146 147 147 const int row0 = img->row0; … … 186 186 imgRowF32 = img->data.F32[i]; // only one of 187 187 imgRowS32 = img->data.S32[i]; // these is valid! 188 maskRow = mask->data.PS_TYPE_ MASK_DATA[i];188 maskRow = mask->data.PS_TYPE_IMAGE_MASK_DATA[i]; 189 189 // 190 190 // Search left from the pixel diagonally to the left of (i - di, x0). If there's … … 354 354 * looking for the rest of the pmFootprint. These are generally set from peaks. 355 355 */ 356 psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_ MASK);356 psImage *mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); 357 357 P_PSIMAGE_SET_ROW0(mask, row0); 358 358 P_PSIMAGE_SET_COL0(mask, col0); … … 365 365 for (int i = 0; i < peaks->n; i++) { 366 366 pmPeak *peak = peaks->data[i]; 367 mask->data.PS_TYPE_ MASK_DATA[peak->y - mask->row0][peak->x - mask->col0] |= PM_SSPAN_STOP;367 mask->data.PS_TYPE_IMAGE_MASK_DATA[peak->y - mask->row0][peak->x - mask->col0] |= PM_SSPAN_STOP; 368 368 } 369 369 } … … 375 375 imgRowF32 = img->data.F32[row]; // only one of 376 376 imgRowS32 = img->data.S32[row]; // these is valid! 377 ps MaskType *maskRow = mask->data.PS_TYPE_MASK_DATA[row];377 psImageMaskType *maskRow = mask->data.PS_TYPE_IMAGE_MASK_DATA[row]; 378 378 { 379 379 int i; -
branches/eam_branch_20081230/psModules/src/objects/pmGrowthCurveGenerate.c
r20937 r21075 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $8 * @date $Date: 2008-12- 08 02:51:14$7 * @version $Revision: 1.4.4.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-12-31 20:31:29 $ 9 9 * 10 10 * Copyright 2004 Institute for Astronomy, University of Hawaii … … 41 41 #include "pmErrorCodes.h" 42 42 43 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, ps MaskType maskVal, psMaskType markVal, float xc, float yc);43 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal, float xc, float yc); 44 44 45 45 /*****************************************************************************/ … … 48 48 49 49 // we generate the growth curve for the center of the image with the specified psf model 50 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, ps MaskType maskVal, psMaskType markVal)50 bool pmGrowthCurveGenerate (pmReadout *readout, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal) 51 51 { 52 52 PS_ASSERT_PTR_NON_NULL(readout, false); … … 119 119 } 120 120 121 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, ps MaskType maskVal, psMaskType markVal, float xc, float yc) {121 pmGrowthCurve *pmGrowthCurveForPosition (psImage *image, pmPSF *psf, bool ignore, psImageMaskType maskVal, psImageMaskType markVal, float xc, float yc) { 122 122 123 123 float fitMag, apMag; … … 162 162 psImage *view = psImageSubset (image, region); 163 163 psImage *pixels = psImageCopy (NULL, view, PS_TYPE_F32); 164 psImage *mask = psImageCopy (NULL, view, PS_TYPE_ U8);164 psImage *mask = psImageCopy (NULL, view, PS_TYPE_IMAGE_MASK); 165 165 166 166 psImageInit (pixels, 0.0); … … 189 189 return NULL; 190 190 } 191 psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_ U8(markVal));191 psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 192 192 193 193 // the 'ignore' mode is for testing -
branches/eam_branch_20081230/psModules/src/objects/pmModel.c
r21072 r21075 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-1 1-09 00:28:18$8 * @version $Revision: 1.25.6.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-12-31 20:31:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 172 172 pmModelOpMode mode, 173 173 bool add, 174 ps MaskType maskVal,174 psImageMaskType maskVal, 175 175 int dx, 176 176 int dy … … 229 229 psF32 **Rx = NULL; 230 230 psF32 **Ry = NULL; 231 ps U8**Rm = NULL;231 psImageMaskType **Rm = NULL; 232 232 233 233 if (model->residuals) { … … 237 237 Rx = (model->residuals->Rx) ? model->residuals->Rx->data.F32 : NULL; 238 238 Ry = (model->residuals->Ry) ? model->residuals->Ry->data.F32 : NULL; 239 Rm = (model->residuals->mask) ? model->residuals->mask->data. U8: NULL;239 Rm = (model->residuals->mask) ? model->residuals->mask->data.PS_TYPE_IMAGE_MASK_DATA : NULL; 240 240 if (Ro) { 241 241 NX = model->residuals->Ro->numCols; … … 249 249 for (psS32 iy = 0; iy < image->numRows; iy++) { 250 250 for (psS32 ix = 0; ix < image->numCols; ix++) { 251 if ((mask != NULL) && (mask->data. U8[iy][ix] & maskVal))251 if ((mask != NULL) && (mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal)) 252 252 continue; 253 253 … … 351 351 pmModel *model, 352 352 pmModelOpMode mode, 353 ps MaskType maskVal)353 psImageMaskType maskVal) 354 354 { 355 355 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); … … 365 365 pmModel *model, 366 366 pmModelOpMode mode, 367 ps MaskType maskVal)367 psImageMaskType maskVal) 368 368 { 369 369 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); … … 379 379 pmModel *model, 380 380 pmModelOpMode mode, 381 ps MaskType maskVal,381 psImageMaskType maskVal, 382 382 int dx, 383 383 int dy) … … 395 395 pmModel *model, 396 396 pmModelOpMode mode, 397 ps MaskType maskVal,397 psImageMaskType maskVal, 398 398 int dx, 399 399 int dy) -
branches/eam_branch_20081230/psModules/src/objects/pmPSFtry.c
r20937 r21075 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.67 $ $Name: not supported by cvs2svn $8 * @date $Date: 2008-12- 08 02:51:14$7 * @version $Revision: 1.67.4.1 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-12-31 20:31:29 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 115 115 test->metricErr = psVectorAlloc (sources->n, PS_TYPE_F32); 116 116 test->fitMag = psVectorAlloc (sources->n, PS_TYPE_F32); 117 test->mask = psVectorAlloc (sources->n, PS_TYPE_ U8);117 test->mask = psVectorAlloc (sources->n, PS_TYPE_VECTOR_MASK); 118 118 119 119 psVectorInit (test->mask, 0); … … 148 148 149 149 // generate a pmPSFtry with a copy of the test PSF sources 150 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, ps MaskType maskVal, psMaskType markVal)150 pmPSFtry *pmPSFtryModel (const psArray *sources, const char *modelName, pmPSFOptions *options, psImageMaskType maskVal, psImageMaskType markVal) 151 151 { 152 152 bool status; … … 189 189 190 190 // clear object mask to define valid pixels 191 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_ U8(markVal));191 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 192 192 193 193 // exclude the poor fits 194 194 if (!status) { 195 psfTry->mask->data. U8[i] = PSFTRY_MASK_EXT_FAIL;195 psfTry->mask->data.PS_TYPE_IMAGE_MASK_DATA[i] = PSFTRY_MASK_EXT_FAIL; 196 196 psTrace ("psModules.objects", 4, "masking %d (%d,%d) : status is poor\n", i, source->peak->x, source->peak->y); 197 197 continue; … … 222 222 223 223 // masked for: bad model fit, outlier in parameters 224 if (psfTry->mask->data. U8[i] & PSFTRY_MASK_ALL) {224 if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) { 225 225 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : source is masked\n", i, source->peak->x, source->peak->y); 226 226 continue; … … 230 230 source->modelPSF = pmModelFromPSF (source->modelEXT, psfTry->psf); 231 231 if (source->modelPSF == NULL) { 232 psfTry->mask->data. U8[i] = PSFTRY_MASK_BAD_MODEL;232 psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_BAD_MODEL; 233 233 abort(); 234 234 continue; … … 244 244 // skip poor fits 245 245 if (!status) { 246 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_ U8(markVal));247 psfTry->mask->data. U8[i] = PSFTRY_MASK_PSF_FAIL;246 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 247 psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_PSF_FAIL; 248 248 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : failed PSF fit\n", i, source->peak->x, source->peak->y); 249 249 continue; … … 252 252 status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal); 253 253 if (!status || isnan(source->apMag)) { 254 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_ U8(markVal));255 psfTry->mask->data. U8[i] = PSFTRY_MASK_BAD_PHOT;254 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 255 psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PSFTRY_MASK_BAD_PHOT; 256 256 psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y); 257 257 continue; … … 259 259 260 260 // clear object mask to define valid pixels 261 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_ U8(markVal));261 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, options->radius, "AND", PS_NOT_IMAGE_MASK(markVal)); 262 262 263 263 psfTry->fitMag->data.F32[i] = source->psfMag; … … 291 291 flux->data.F32[i] = 0.0; 292 292 chisq->data.F32[i] = 0.0; 293 mask->data. U8[i] = 0xff;293 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0xff; 294 294 } else { 295 295 flux->data.F32[i] = source->modelPSF->params->data.F32[PM_PAR_I0]; 296 296 chisq->data.F32[i] = source->modelPSF->chisq / source->modelPSF->nDOF; 297 mask->data. U8[i] = 0;297 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 298 298 } 299 299 } … … 361 361 362 362 for (int i = 0; i < psfTry->sources->n; i++) { 363 if (psfTry->mask->data. U8[i] & PSFTRY_MASK_ALL)363 if (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL) 364 364 continue; 365 365 r2rflux->data.F32[i] = PS_SQR(RADIUS) * pow(10.0, 0.4*psfTry->fitMag->data.F32[i]); … … 370 370 FILE *f = fopen ("apresid.dat", "w"); 371 371 for (int i = 0; i < psfTry->sources->n; i++) { 372 int keep = (psfTry->mask->data. U8[i] & PSFTRY_MASK_ALL);372 int keep = (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL); 373 373 374 374 pmSource *source = psfTry->sources->data[i]; … … 418 418 psVector *apfit = psPolynomial1DEvalVector (poly, r2rflux); 419 419 for (int i = 0; i < psfTry->sources->n; i++) { 420 int keep = (psfTry->mask->data. U8[i] & PSFTRY_MASK_ALL);420 int keep = (psfTry->mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PSFTRY_MASK_ALL); 421 421 422 422 pmSource *source = psfTry->sources->data[i]; … … 613 613 614 614 psVector *dz = NULL; 615 psVector *mask = psVectorAlloc (sources->n, PS_TYPE_ U8);615 psVector *mask = psVectorAlloc (sources->n, PS_TYPE_VECTOR_MASK); 616 616 617 617 // check the fit residuals and increase Nx,Ny until the error is minimized … … 647 647 // copy mask back to srcMask 648 648 for (int i = 0; i < mask->n; i++) { 649 srcMask->data. U8[i] = mask->data.U8[i];649 srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = mask->data.PS_TYPE_VECTOR_MASK_DATA[i]; 650 650 } 651 651 … … 720 720 pmTrend2DEval (psf->params->data[PM_PAR_E1], x->data.F32[i], y->data.F32[i]), 721 721 pmTrend2DEval (psf->params->data[PM_PAR_E2], x->data.F32[i], y->data.F32[i]), 722 srcMask->data. U8[i]);722 srcMask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 723 723 } 724 724 fclose (f); … … 835 835 836 836 // the mask marks the values not used to calculate the ApTrend 837 psVector *fitMask = psVectorAlloc (x_fit->n, PS_TYPE_ U8);837 psVector *fitMask = psVectorAlloc (x_fit->n, PS_TYPE_VECTOR_MASK); 838 838 psVectorInit (fitMask, 0); 839 839 … … 924 924 // XXX copy fitMask values back to mask 925 925 for (int i = 0; i < fitMask->n; i++) { 926 mask->data. U8[i] = fitMask->data.U8[i];926 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = fitMask->data.PS_TYPE_VECTOR_MASK_DATA[i]; 927 927 } 928 928 psFree (fitMask); … … 975 975 psVector *dE1subset = psVectorAllocEmpty (nGroup, PS_TYPE_F32); 976 976 psVector *dE2subset = psVectorAllocEmpty (nGroup, PS_TYPE_F32); 977 psVector *mkSubset = psVectorAllocEmpty (nGroup, PS_TYPE_ U8);977 psVector *mkSubset = psVectorAllocEmpty (nGroup, PS_TYPE_VECTOR_MASK); 978 978 979 979 int n = 0; … … 988 988 dE2subset->data.F32[j] = e2res->data.F32[N]; 989 989 990 mkSubset->data. U8[j] = mask->data.U8[N];991 if (!mask->data. U8[N]) nValid ++;990 mkSubset->data.PS_TYPE_VECTOR_MASK_DATA[j] = mask->data.PS_TYPE_VECTOR_MASK_DATA[N]; 991 if (!mask->data.PS_TYPE_VECTOR_MASK_DATA[N]) nValid ++; 992 992 } 993 993 if (nValid < 3) continue; -
branches/eam_branch_20081230/psModules/src/objects/pmSource.c
r20937 r21075 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-12- 08 02:51:14$8 * @version $Revision: 1.66.4.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-12-31 20:31:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 505 505 *****************************************************************************/ 506 506 507 bool pmSourceRoughClass(psRegion *region, psArray *sources, psMetadata *recipe, pmPSFClump clump, ps MaskType maskSat)507 bool pmSourceRoughClass(psRegion *region, psArray *sources, psMetadata *recipe, pmPSFClump clump, psImageMaskType maskSat) 508 508 { 509 509 psTrace("psModules.objects", 5, "---- begin ----"); … … 738 738 psF32 *vPix = source->pixels->data.F32[row]; 739 739 psF32 *vWgt = source->weight->data.F32[row]; 740 ps U8 *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.U8[row];740 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 741 741 742 742 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) { … … 848 848 # endif 849 849 // construct a realization of the source model 850 bool pmSourceCacheModel (pmSource *source, ps MaskType maskVal) {850 bool pmSourceCacheModel (pmSource *source, psImageMaskType maskVal) { 851 851 PS_ASSERT_PTR_NON_NULL(source, false); 852 852 // select appropriate model … … 867 867 // construct a realization of the source model 868 868 // XXX this function should optionally save an existing psf image from modelFlux 869 bool pmSourceCachePSF (pmSource *source, ps MaskType maskVal) {869 bool pmSourceCachePSF (pmSource *source, psImageMaskType maskVal) { 870 870 PS_ASSERT_PTR_NON_NULL(source, false); 871 871 … … 885 885 886 886 // should we call pmSourceCacheModel if it does not exist? 887 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, ps MaskType maskVal, int dx, int dy)887 bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add, psImageMaskType maskVal, int dx, int dy) 888 888 { 889 889 PS_ASSERT_PTR_NON_NULL(source, false); … … 915 915 } 916 916 917 ps U8**mask = NULL;917 psImageMaskType **mask = NULL; 918 918 if (source->maskObj) { 919 mask = source->maskObj->data. U8;919 mask = source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA; 920 920 } 921 921 … … 957 957 } 958 958 959 bool pmSourceAdd (pmSource *source, pmModelOpMode mode, ps MaskType maskVal) {959 bool pmSourceAdd (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal) { 960 960 return pmSourceOp (source, mode, true, maskVal, 0, 0); 961 961 } 962 962 963 bool pmSourceSub (pmSource *source, pmModelOpMode mode, ps MaskType maskVal) {963 bool pmSourceSub (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal) { 964 964 return pmSourceOp (source, mode, false, maskVal, 0, 0); 965 965 } 966 966 967 bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, ps MaskType maskVal, int dx, int dy) {967 bool pmSourceAddWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy) { 968 968 return pmSourceOp (source, mode, true, maskVal, dx, dy); 969 969 } 970 970 971 bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, ps MaskType maskVal, int dx, int dy) {971 bool pmSourceSubWithOffset (pmSource *source, pmModelOpMode mode, psImageMaskType maskVal, int dx, int dy) { 972 972 return pmSourceOp (source, mode, false, maskVal, dx, dy); 973 973 } -
branches/eam_branch_20081230/psModules/src/objects/pmSourceFitModel.c
r20937 r21075 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-12- 08 02:51:14$8 * @version $Revision: 1.28.4.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-12-31 20:31:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 56 56 pmModel *model, 57 57 pmSourceFitMode mode, 58 ps MaskType maskVal)58 psImageMaskType maskVal) 59 59 { 60 60 psTrace("psModules.objects", 5, "---- %s begin ----\n", __func__); … … 81 81 for (psS32 j = 0; j < source->pixels->numCols; j++) { 82 82 // skip masked points 83 if (source->maskObj->data. U8[i][j] & maskVal) {83 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) { 84 84 continue; 85 85 } … … 121 121 // create the minimization constraints 122 122 psMinConstraint *constraint = psMinConstraintAlloc(); 123 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_ U8);123 constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK_DATA); 124 124 constraint->checkLimits = model->modelLimits; 125 125 … … 131 131 nParams = 1; 132 132 psVectorInit (constraint->paramMask, 1); 133 constraint->paramMask->data. U8[PM_PAR_I0] = 0;133 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0; 134 134 break; 135 135 case PM_SOURCE_FIT_PSF: … … 137 137 nParams = 3; 138 138 psVectorInit (constraint->paramMask, 1); 139 constraint->paramMask->data. U8[PM_PAR_I0] = 0;140 constraint->paramMask->data. U8[PM_PAR_XPOS] = 0;141 constraint->paramMask->data. U8[PM_PAR_YPOS] = 0;139 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_I0] = 0; 140 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_XPOS] = 0; 141 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_YPOS] = 0; 142 142 break; 143 143 case PM_SOURCE_FIT_EXT: … … 145 145 nParams = params->n - 1; 146 146 psVectorInit (constraint->paramMask, 0); 147 constraint->paramMask->data. U8[PM_PAR_SKY] = 1;147 constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[PM_PAR_SKY] = 1; 148 148 break; 149 149 default: … … 175 175 fprintf (stderr, "%f ", params->data.F32[i]); 176 176 } 177 if ((constraint->paramMask != NULL) && constraint->paramMask->data. U8[i])177 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 178 178 continue; 179 179 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); … … 192 192 if (constraint->paramMask != NULL) { 193 193 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32); 194 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_ U8);195 altmask->data. U8[0] = 1;194 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 195 altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1; 196 196 for (int i = 1; i < dparams->n; i++) { 197 altmask->data. U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;197 altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1; 198 198 } 199 199 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc); 200 200 201 201 for (int i = 0; i < dparams->n; i++) { 202 if (!constraint->paramMask->data. U8[i])202 if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 203 203 continue; 204 204 // note that delta is the value *subtracted* from the parameter -
branches/eam_branch_20081230/psModules/src/objects/pmSourceFitSet.c
r20937 r21075 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-12- 08 02:51:14$8 * @version $Revision: 1.12.4.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-12-31 20:31:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 281 281 for (int j = 0; j < paramOne->n; j++) { 282 282 if (j == PM_PAR_I0) continue; 283 constraint->paramMask->data. U8[n + j] = 1;283 constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + j] = 1; 284 284 } 285 285 break; … … 290 290 if (j == PM_PAR_YPOS) continue; 291 291 if (j == PM_PAR_I0) continue; 292 constraint->paramMask->data. U8[n + j] = 1;292 constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + j] = 1; 293 293 } 294 294 break; 295 295 case PM_SOURCE_FIT_EXT: 296 296 // EXT model fits all params (except sky) 297 constraint->paramMask->data. U8[n + PM_PAR_SKY] = 1;297 constraint->paramMask->data.PS_TYPE_IMAGE_MASK_DATA[n + PM_PAR_SKY] = 1; 298 298 break; 299 299 default: … … 332 332 psArray *modelSet, 333 333 pmSourceFitMode mode, 334 ps MaskType maskVal)334 psImageMaskType maskVal) 335 335 { 336 336 psTrace("psModules.objects", 3, "---- %s begin ----\n", __func__); … … 356 356 for (psS32 j = 0; j < source->pixels->numCols; j++) { 357 357 // skip masked points 358 if (source->maskObj->data. U8[i][j] & maskVal) {358 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j] & maskVal) { 359 359 continue; 360 360 } … … 402 402 // create the minimization constraints 403 403 psMinConstraint *constraint = psMinConstraintAlloc(); 404 constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_ U8);404 constraint->paramMask = psVectorAlloc (thisSet->nParamSet, PS_TYPE_VECTOR_MASK); 405 405 constraint->checkLimits = pmSourceFitSetCheckLimits; 406 406 … … 415 415 if (psTraceGetLevel("psModules.objects") >= 5) { 416 416 for (int i = 0; i < params->n; i++) { 417 fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data. U8[i]);417 fprintf (stderr, "%d %f %d\n", i, params->data.F32[i], constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 418 418 } 419 419 } … … 448 448 psVector *dparams = psVectorAlloc (thisSet->nParamSet, PS_TYPE_F32); 449 449 for (int i = 0; i < dparams->n; i++) { 450 if ((constraint->paramMask != NULL) && constraint->paramMask->data. U8[i])450 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 451 451 continue; 452 452 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); … … 456 456 if (constraint->paramMask != NULL) { 457 457 psVector *delta = psVectorAlloc (params->n, PS_TYPE_F32); 458 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_ U8);459 altmask->data. U8[0] = 1;458 psVector *altmask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK); 459 altmask->data.PS_TYPE_VECTOR_MASK_DATA[0] = 1; 460 460 for (int i = 1; i < dparams->n; i++) { 461 altmask->data. U8[i] = (constraint->paramMask->data.U8[i]) ? 0 : 1;461 altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1; 462 462 } 463 463 psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, pmSourceFitSetFunction); 464 464 465 465 for (int i = 0; i < dparams->n; i++) { 466 if (!constraint->paramMask->data. U8[i])466 if (!constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 467 467 continue; 468 468 // note that delta is the value *subtracted* from the parameter -
branches/eam_branch_20081230/psModules/src/objects/pmSourcePhotometry.c
r20937 r21075 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $6 * @date $Date: 2008-12- 08 02:51:14$5 * @version $Revision: 1.47.4.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-12-31 20:31:29 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 66 66 67 67 // XXX masked region should be (optionally) elliptical 68 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, ps MaskType maskVal)68 bool pmSourceMagnitudes (pmSource *source, pmPSF *psf, pmSourcePhotometryMode mode, psImageMaskType maskVal) 69 69 { 70 70 PS_ASSERT_PTR_NON_NULL(source, false); … … 306 306 307 307 // return source aperture magnitude 308 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, ps MaskType maskVal)308 bool pmSourcePhotometryAper (float *apMag, pmModel *model, psImage *image, psImage *mask, psImageMaskType maskVal) 309 309 { 310 310 PS_ASSERT_PTR_NON_NULL(apMag, false); … … 324 324 325 325 psF32 **imData = image->data.F32; 326 ps U8 **mkData = mask->data.U8;326 psImageMaskType **mkData = mask->data.PS_TYPE_IMAGE_MASK_DATA; 327 327 328 328 // measure apMag … … 344 344 345 345 // return source aperture magnitude 346 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, ps MaskType maskVal)346 bool pmSourcePixelWeight (float *pixWeight, pmModel *model, psImage *image, psImage *mask, psImageMaskType maskVal) 347 347 { 348 348 PS_ASSERT_PTR_NON_NULL(pixWeight, false); … … 412 412 if (my >= NY) 413 413 continue; 414 if (mask->data. U8[my][mx] & maskVal)414 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & maskVal) 415 415 continue; 416 416 … … 475 475 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { 476 476 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) { 477 if (Ti->data. U8[yi][xi])478 continue; 479 if (Tj->data. U8[yj][xj])477 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 478 continue; 479 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj]) 480 480 continue; 481 481 … … 540 540 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { 541 541 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) { 542 if (Ti->data. U8[yi][xi])543 continue; 544 if (Tj->data. U8[yj][xj])542 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 543 continue; 544 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj]) 545 545 continue; 546 546 … … 578 578 for (int yi = 0; yi < Pi->numRows; yi++) { 579 579 for (int xi = 0; xi < Pi->numCols; xi++) { 580 if (Ti->data. U8[yi][xi])580 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 581 581 continue; 582 582 if (!unweighted_sum) { … … 613 613 614 614 bool pmSourceChisq (pmModel *model, psImage *image, psImage *mask, psImage *weight, 615 ps MaskType maskVal)615 psImageMaskType maskVal) 616 616 { 617 617 PS_ASSERT_PTR_NON_NULL(model, false); … … 624 624 for (int j = 0; j < image->numRows; j++) { 625 625 for (int i = 0; i < image->numCols; i++) { 626 if (mask->data. U8[j][i] & maskVal)626 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal) 627 627 continue; 628 628 if (weight->data.F32[j][i] <= 0) … … 657 657 for (int yi = 0; yi < Pi->numRows; yi++) { 658 658 for (int xi = 0; xi < Pi->numCols; xi++) { 659 if (Ti->data. U8[yi][xi])659 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 660 660 continue; 661 661 if (!unweighted_sum) { … … 734 734 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { 735 735 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) { 736 if (Ti->data. U8[yi][xi])737 continue; 738 if (Tj->data. U8[yj][xj])736 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 737 continue; 738 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj]) 739 739 continue; 740 740 … … 798 798 for (yi = yIs, yj = yJs; yi < yIe; yi++, yj++) { 799 799 for (xi = xIs, xj = xJs; xi < xIe; xi++, xj++) { 800 if (Ti->data. U8[yi][xi])801 continue; 802 if (Tj->data. U8[yj][xj])800 if (Ti->data.PS_TYPE_IMAGE_MASK_DATA[yi][xi]) 801 continue; 802 if (Tj->data.PS_TYPE_IMAGE_MASK_DATA[yj][xj]) 803 803 continue; 804 804 -
branches/eam_branch_20081230/psModules/src/objects/pmSourceSky.c
r20937 r21075 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $9 * @date $Date: 2008-12- 08 02:51:14$8 * @version $Revision: 1.18.4.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-12-31 20:31:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 52 52 psStatsOptions statsOptions, 53 53 psF32 Radius, 54 ps MaskType maskVal,55 ps MaskType markVal)54 psImageMaskType maskVal, 55 psImageMaskType markVal) 56 56 { 57 57 psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__); … … 86 86 return false; 87 87 } 88 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_ U8(markVal));88 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_IMAGE_MASK(markVal)); 89 89 double value = psStatsGetValue(myStats, statistic); 90 90 psFree(myStats); … … 107 107 psStatsOptions statsOptions, 108 108 psF32 Radius, 109 ps MaskType maskVal,110 ps MaskType markVal109 psImageMaskType maskVal, 110 psImageMaskType markVal 111 111 ) 112 112 { … … 142 142 return false; 143 143 } 144 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_ U8(markVal));144 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_IMAGE_MASK(markVal)); 145 145 double value = psStatsGetValue(myStats, statistic); 146 146 psFree(myStats); -
branches/eam_branch_20081230/psModules/src/objects/pmTrend2D.c
r19961 r21075 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $6 * @date $Date: 2008-1 0-07 22:47:04$5 * @version $Revision: 1.10.14.1 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2008-12-31 20:31:29 $ 7 7 * Copyright 2004 Institute for Astronomy, University of Hawaii 8 8 * … … 179 179 } 180 180 181 bool pmTrend2DFit(pmTrend2D *trend, psVector *mask, ps MaskType maskVal, const psVector *x,181 bool pmTrend2DFit(pmTrend2D *trend, psVector *mask, psVectorMaskType maskVal, const psVector *x, 182 182 const psVector *y, const psVector *f, const psVector *df) 183 183 {
Note:
See TracChangeset
for help on using the changeset viewer.
