Changeset 4992
- Timestamp:
- Sep 11, 2005, 12:25:39 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
psLib/src/math/psMinimize.c (modified) (2 diffs)
-
psModules/src/pmAstrometry.c (modified) (5 diffs)
-
psModules/src/pmAstrometry.h (modified) (2 diffs)
-
psModules/src/pmImageCombine.c (modified) (7 diffs)
-
psModules/src/pmImageCombine.h (modified) (2 diffs)
-
psModules/src/pmImageSubtract.c (modified) (10 diffs)
-
psModules/src/pmImageSubtract.h (modified) (3 diffs)
-
psModules/src/pmObjects.c (modified) (6 diffs)
-
psModules/src/pmObjects.h (modified) (7 diffs)
-
psModules/src/pmReadoutCombine.c (modified) (5 diffs)
-
psModules/test/Makefile.am (modified) (2 diffs)
-
psModules/test/tst_pmImageCombine.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.c
r4991 r4992 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.13 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09-11 22: 18:40$12 * @version $Revision: 1.136 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-11 22:25:29 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 306 306 PS_ASSERT_VECTOR_NON_NULL(beta, NAN); 307 307 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 308 PS_ASSERT_ VECTOR_NON_NULL(x, NAN);308 PS_ASSERT_PTR_NON_NULL(x, NAN); 309 309 PS_ASSERT_VECTOR_NON_NULL(y, NAN); 310 310 PS_ASSERT_VECTOR_NON_NULL(dy, NAN); -
trunk/psModules/src/pmAstrometry.c
r4779 r4992 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 8-16 02:29:29 $10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-11 22:25:39 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 106 106 } 107 107 108 108 // XXX: Verify these default values for row0, col0, rowBins, colBins 109 109 pmReadout *pmReadoutAlloc(pmCell *cell) 110 110 { … … 707 707 */ 708 708 709 // XXX: How should we handle errors? What if psMetadataLookup() is NULL? 709 710 psMetadataItem *pmReadoutGetConcept(pmReadout *readout, const char *concept) 710 711 { … … 794 795 } 795 796 796 psRegion *pmCellGetTrimSec(pmCell *cell) // CELL.TRIMSEC797 psRegion pmCellGetTrimSec(pmCell *cell) // CELL.TRIMSEC 797 798 { 798 799 psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.TRIMSEC"); 799 return((psRegion *) tmp->data.V);800 return((psRegion) *((psRegion *) (tmp->data.V))); 800 801 } 801 802 … … 824 825 } 825 826 826 psPixelCoord *pmCellGetBin(pmCell *cell) // CELL.BIN 827 828 psPixelCoord pmCellGetBin(pmCell *cell) // CELL.BIN 827 829 { 828 830 psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.BIN"); 829 return((psPixelCoord *) tmp->data.V);830 } 831 832 psPixelCoord *pmCellGetParity(pmCell *cell) // CELL.PARITY831 return((psPixelCoord) *((psPixelCoord *) (tmp->data.V))); 832 } 833 834 psPixelCoord pmCellGetParity(pmCell *cell) // CELL.PARITY 833 835 { 834 836 psMetadataItem *tmp = pmCellGetConcept(cell, "CELL.PARITY"); 835 return((psPixelCoord *) tmp->data.V);837 return((psPixelCoord) *((psPixelCoord *) (tmp->data.V))); 836 838 } 837 839 -
trunk/psModules/src/pmAstrometry.h
r4779 r4992 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 8-16 02:29:29 $10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-11 22:25:39 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 441 441 psTime *pmCellGetTime(pmCell *cell); // CELL.TIME 442 442 psList *pmCellGetBiasSec(pmCell *cell); // CELL.BIASSEC 443 psRegion *pmCellGetTrimSec(pmCell *cell); // CELL.TRIMSEC443 psRegion pmCellGetTrimSec(pmCell *cell); // CELL.TRIMSEC 444 444 float pmCellGetGain(pmCell *cell); // CELL.GAIN 445 445 float pmCellGetReadNoise(pmCell *cell); // CELL.READNOISE 446 446 float pmCellGetSaturation(pmCell *cell); // CELL.SATURATION 447 447 float pmCellGetBad(pmCell *cell); // CELL.BAD 448 psPixelCoord *pmCellGetBin(pmCell *cell); // CELL.BIN449 psPixelCoord *pmCellGetParity(pmCell *cell); // CELL.PARITY448 psPixelCoord pmCellGetBin(pmCell *cell); // CELL.BIN 449 psPixelCoord pmCellGetParity(pmCell *cell); // CELL.PARITY 450 450 float pmReadoutGetExposure(pmReadout *readout); // READOUT.EXPOSURE 451 451 float pmReadoutGetDarkTime(pmReadout *readout); // READOUT.DARKTIME -
trunk/psModules/src/pmImageCombine.c
r4425 r4992 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 6-29 01:39:10$10 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-11 22:25:39 $ 12 12 * 13 13 * XXX: pmRejectPixels() has a known bug with the pmImageTransform() call. … … 308 308 /****************************************************************************** 309 309 XXX: Directly from Paul Price 310 XXX: Must add mask parameter, use it in gradient calculation.311 310 *****************************************************************************/ 312 static psF32 CalcGradient(psImage *image, 313 psS32 x, 314 psS32 y) 311 static psF32 CalcGradient( 312 psImage *image, 313 psImage *imageMask, 314 psS32 x, 315 psS32 y 316 ) 315 317 { 316 318 psTrace("ImageCombine.CalcGradient", 4, "Calling CalcGradient(%d, %d)\n", x, y); … … 324 326 int yMin = PS_MAX(y - 1, 0); 325 327 int yMax = PS_MIN(y + 1, image->numRows - 1); 326 for (int j = yMin; j <= yMax; j++) { 327 for (int i = xMin; i <= xMax; i++) { 328 if ((i != x) && (j != y)) { 329 pixels->data.F32[num] = image->data.F32[j][i]; 330 mask->data.U8[num] = 0; 331 num++; 328 if (imageMask != NULL) { 329 for (int j = yMin; j <= yMax; j++) { 330 for (int i = xMin; i <= xMax; i++) { 331 if ((i != x) && (j != y) && (0 == imageMask->data.U8[j][i])) { 332 pixels->data.F32[num] = image->data.F32[j][i]; 333 mask->data.U8[num] = 0; 334 num++; 335 } else { 336 mask->data.U8[num] = 1; 337 } 332 338 } 333 339 } 334 } 340 } else { 341 // 342 // This code is simply the previous loop without the imageMask. 343 // XXX: Consider restructuring this. 344 // 345 for (int j = yMin; j <= yMax; j++) { 346 for (int i = xMin; i <= xMax; i++) { 347 if ((i != x) && (j != y)) { 348 pixels->data.F32[num] = image->data.F32[j][i]; 349 mask->data.U8[num] = 0; 350 num++; 351 } else { 352 mask->data.U8[num] = 1; 353 } 354 } 355 } 356 } 357 335 358 pixels->n = num; 336 359 mask->n = num; … … 472 495 XXX: The inToOut and outToIn transforms are confusing. Verify that what 473 496 I think they mean syncs with PWP. 474 XXX: Must add mask parameter, use it in gradient calculation.475 497 *****************************************************************************/ 476 psArray *pmRejectPixels(const psArray *images, ///< Array of input images 477 const psArray *errors, ///< The pixels which were rejected in the combination 478 const psArray *inToOut, ///< Transformation from input to output system 479 const psArray *outToIn, ///< Transformation from output to input system 480 psF32 rejThreshold, ///< Rejection threshold 481 psF32 gradLimit ///< Gradient limit 482 ) 498 psArray *pmRejectPixels( 499 const psArray *images, ///< Array of input images 500 const psArray *masks, ///< Array of input image masks 501 const psArray *errors, ///< The pixels which were rejected in the combination 502 const psArray *inToOut, ///< Transformation from input to output system 503 const psArray *outToIn, ///< Transformation from output to input system 504 psF32 rejThreshold, ///< Rejection threshold 505 psF32 gradLimit ///< Gradient limit 506 ) 483 507 { 484 508 psTrace("ImageCombine.pmRejectPixels", 3, "Calling pmRejectPixels()\n"); 485 509 PS_ASSERT_PTR_NON_NULL(images, NULL); 510 for (psS32 im = 0 ; im < images->n ; im++) { 511 psImage *tmpImage = (psImage *) images->data[im]; 512 PS_ASSERT_IMAGE_NON_NULL(tmpImage, NULL); 513 PS_ASSERT_IMAGE_NON_EMPTY(tmpImage, NULL); 514 PS_ASSERT_IMAGE_TYPE(tmpImage, PS_TYPE_F32, NULL); 515 if (masks != NULL) { 516 PS_ASSERT_INT_EQUAL(images->n, masks->n, NULL); 517 psImage *tmpMask = (psImage *) masks->data[im]; 518 PS_ASSERT_IMAGE_NON_NULL(tmpMask, NULL); 519 PS_ASSERT_IMAGE_NON_EMPTY(tmpMask, NULL); 520 PS_ASSERT_IMAGE_TYPE(tmpMask, PS_TYPE_F32, NULL); 521 PS_ASSERT_IMAGES_SIZE_EQUAL(tmpImage, tmpMask, NULL); 522 } 523 PS_ASSERT_IMAGES_SIZE_EQUAL(((psImage *) images->data[0]), tmpImage, NULL); 524 } 486 525 PS_ASSERT_PTR_NON_NULL(errors, NULL); 487 526 PS_ASSERT_PTR_NON_NULL(inToOut, NULL); … … 492 531 PS_ASSERT_INT_EQUAL(numImages, inToOut->n, NULL); 493 532 PS_ASSERT_INT_EQUAL(numImages, outToIn->n, NULL); 494 // XXX: Loop through all images, ensure their sizes are equal495 533 496 534 // … … 570 608 if (im != otherImg) { 571 609 // Map the outCoords to inCoords that for otherImg space. 610 psImage *tmpMask = NULL; 611 if (masks != NULL) { 612 tmpMask = masks->data[otherImg]; 613 } 572 614 psPlaneTransformApply(inCoords, 573 615 (psPlaneTransform * )outToIn->data[otherImg], … … 577 619 if ((xPix >= 0) && (xPix <= ((psImage*)(images->data[otherImg]))->numCols - 1) && 578 620 (yPix >= 0) && (yPix <= ((psImage*)(images->data[otherImg]))->numRows - 1)) { 579 meanGrads += CalcGradient(images->data[otherImg], xPix, yPix);621 meanGrads += CalcGradient(images->data[otherImg], tmpMask, xPix, yPix); 580 622 numGrads++; 581 623 } -
trunk/psModules/src/pmImageCombine.h
r4217 r4992 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 6-13 19:36:12$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-11 22:25:39 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "pslib.h" 27 27 28 psImage *pmCombineImages(psImage *combine, ///< Combined image (output) 29 psArray **questionablePixels, ///< Array of rejection masks 30 const psArray *images, ///< Array of input images 31 const psArray *errors, ///< Array of input error images 32 const psArray *masks, ///< Array of input masks 33 psU32 maskVal, ///< Mask value 34 const psPixels *pixels, ///< Pixels to combine 35 psS32 numIter, ///< Number of rejection iterations 36 psF32 sigmaClip, ///< Number of standard deviations at which to reject 37 const psStats *stats ///< Statistics to use in the combination 38 ); 28 psImage *pmCombineImages( 29 psImage *combine, ///< Combined image (output) 30 psArray **questionablePixels, ///< Array of rejection masks 31 const psArray *images, ///< Array of input images 32 const psArray *errors, ///< Array of input error images 33 const psArray *masks, ///< Array of input masks 34 psU32 maskVal, ///< Mask value 35 const psPixels *pixels, ///< Pixels to combine 36 psS32 numIter, ///< Number of rejection iterations 37 psF32 sigmaClip, ///< Number of standard deviations at which to reject 38 const psStats *stats ///< Statistics to use in the combination 39 ); 39 40 40 psArray *pmRejectPixels(const psArray *images, ///< Array of input images 41 const psArray *errors, ///< The pixels which were rejected in the combination 42 const psArray *inToOut, ///< Transformation from input to output system 43 const psArray *outToIn, ///< Transformation from output to input system 44 psF32 rejThreshold, ///< Rejection threshold 45 psF32 gradLimit ///< Gradient limit 46 ); 41 psArray *pmRejectPixels( 42 const psArray *images, ///< Array of input images 43 const psArray *masks, ///< Array of input image masks 44 const psArray *errors, ///< The pixels which were rejected in the combination 45 const psArray *inToOut, ///< Transformation from input to output system 46 const psArray *outToIn, ///< Transformation from output to input system 47 psF32 rejThreshold, ///< Rejection threshold 48 psF32 gradLimit ///< Gradient limit 49 ); 47 50 #endif -
trunk/psModules/src/pmImageSubtract.c
r4579 r4992 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-19 01:44:48$9 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-11 22:25:39 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 124 124 tmp->subIndex = 0; 125 125 tmp->preCalc = NULL; 126 tmp-> p_size = size;127 tmp-> p_spatialOrder = spatialOrder;126 tmp->size = size; 127 tmp->spatialOrder = spatialOrder; 128 128 129 129 // … … 220 220 tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32); 221 221 tmp->subIndex = 0; 222 tmp-> p_size = size;223 tmp-> p_spatialOrder = spatialOrder;222 tmp->size = size; 223 tmp->spatialOrder = spatialOrder; 224 224 tmp->preCalc = psArrayAlloc(nBF); 225 225 … … 499 499 psTrace("ImageSubtract.IsisKernelConvolve", 4, 500 500 "Calling IsisKernelConvolve(%d, %d, %d)\n", kernelID, col, row); 501 psS32 spatialOrder = kernels-> p_spatialOrder;502 psS32 kernelSize = kernels-> p_size;501 psS32 spatialOrder = kernels->spatialOrder; 502 psS32 kernelSize = kernels->size; 503 503 psS32 xOrder = (psS32) kernels->xOrder->data.F32[kernelID]; 504 504 psS32 yOrder = (psS32) kernels->yOrder->data.F32[kernelID]; … … 557 557 psF32 numRowsHalf = 0.5 * (psF32) input->numRows; 558 558 psF32 background = solution->data.F64[solution->n-1]; 559 psS32 spatialOrder = kernels-> p_spatialOrder;559 psS32 spatialOrder = kernels->spatialOrder; 560 560 psF32 conv = background; // Initial convolved value 561 561 … … 671 671 psS32 numCols = input->numCols; 672 672 psS32 numRows = input->numRows; 673 psS32 kernelSize = kernels-> p_size;673 psS32 kernelSize = kernels->size; 674 674 675 675 psImage *convolved = psImageAlloc(numCols, numRows, PS_TYPE_F32); … … 746 746 PS_ASSERT_VECTORS_SIZE_EQUAL(kernels->u, kernels->preCalc, false); 747 747 } 748 psS32 kernelSize = kernels-> p_size;748 psS32 kernelSize = kernels->size; 749 749 PS_ASSERT_INT_NONNEGATIVE(footprint, false); 750 750 // … … 777 777 psS32 numHalfRows = reference->numRows; 778 778 psS32 numHalfCols = reference->numCols; 779 psS32 spatialOrder = kernels-> p_spatialOrder;779 psS32 spatialOrder = kernels->spatialOrder; 780 780 781 781 // … … 1163 1163 PS_ASSERT_VECTOR_SIZE(solution, nBF+1, NULL); 1164 1164 1165 psS32 kernelSize = kernels-> p_size;1165 psS32 kernelSize = kernels->size; 1166 1166 int xSize = footprint + kernelSize; 1167 1167 int ySize = footprint + kernelSize; … … 1332 1332 1333 1333 psS32 nBF = kernels->u->n; 1334 psS32 spatialOrder = kernels-> p_spatialOrder;1335 psS32 kernelSize = kernels-> p_size;1334 psS32 spatialOrder = kernels->spatialOrder; 1335 psS32 kernelSize = kernels->size; 1336 1336 1337 1337 if (out != NULL) { -
trunk/psModules/src/pmImageSubtract.h
r4417 r4992 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-28 23:23:55$9 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-11 22:25:39 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 28 28 typedef enum { 29 PM_SUBTRACTION_KERNEL_POIS, ///< POIS kernel --- delta functions30 PM_SUBTRACTION_KERNEL_ISIS ///< ISIS kernel --- gaussians modified by polynomials29 PM_SUBTRACTION_KERNEL_POIS, ///< POIS kernel --- delta functions 30 PM_SUBTRACTION_KERNEL_ISIS ///< ISIS kernel --- gaussians modified by polynomials 31 31 } pmSubtractionKernelsType; 32 32 33 33 typedef struct 34 34 { 35 pmSubtractionKernelsType type; ///< Type ofKernels --- allowing the use of multiple kernels36 psVector *u, *v; ///< Offset (for POIS) or polynomial order (for ISIS)37 psVector *sigma; ///< Width of Gaussian (for ISIS)38 psVector *xOrder, *yOrder; ///< Spatial Polynomial order (for all)39 int subIndex; ///< Index of kernel to be subtracted to maintain flux conservation40 psArray *preCalc; ///< Array of images containing pre-calculated kernel (to35 pmSubtractionKernelsType type; ///< Type ofKernels --- allowing the use of multiple kernels 36 psVector *u, *v; ///< Offset (for POIS) or polynomial order (for ISIS) 37 psVector *sigma; ///< Width of Gaussian (for ISIS) 38 psVector *xOrder, *yOrder; ///< Spatial Polynomial order (for all) 39 int subIndex; ///< Index of kernel to be subtracted to maintain flux conservation 40 psArray *preCalc; ///< Array of images containing pre-calculated kernel (to 41 41 ///< accelerate ISIS; don't use for POIS) 42 psS32 p_size;///< The halfsize of the kernel43 psS32 p_spatialOrder;///< The spatial order of the kernels42 psS32 size; ///< The halfsize of the kernel 43 psS32 spatialOrder; ///< The spatial order of the kernels 44 44 } 45 45 psSubtractionKernels; 46 46 47 psSubtractionKernels *pmSubtractionKernelsAllocPOIS(int size, 48 int SpatialOrder); 47 psSubtractionKernels *pmSubtractionKernelsAllocPOIS( 48 int size, 49 int SpatialOrder 50 ); 49 51 50 psSubtractionKernels *pmSubtractionKernelsAllocISIS(const psVector *sigmas, 51 const psVector *orders, 52 int size, 53 int SpatialOrder); 52 psSubtractionKernels *pmSubtractionKernelsAllocISIS( 53 const psVector *sigmas, 54 const psVector *orders, 55 int size, 56 int SpatialOrder 57 ); 54 58 55 59 typedef enum { 56 PM_STAMP_INIT, ///< Initial state57 PM_STAMP_USED, ///< Use this stamp58 PM_STAMP_REJECTED, ///< This stamp has been rejected59 PM_STAMP_RECALC, ///< Having been reset, this stamp is to be recalculated60 PM_STAMP_NONE ///< No stamp in this region60 PM_STAMP_INIT, ///< Initial state 61 PM_STAMP_USED, ///< Use this stamp 62 PM_STAMP_REJECTED, ///< This stamp has been rejected 63 PM_STAMP_RECALC, ///< Having been reset, this stamp is to be recalculated 64 PM_STAMP_NONE ///< No stamp in this region 61 65 } pmStampStatus; 62 66 63 67 typedef struct 64 68 { 65 int x, y; ///< Position69 int x, y; ///< Position 66 70 int p_xSize; 67 71 int p_ySize; … … 70 74 int p_yMin; 71 75 int p_yMax; 72 psImage *matrix; ///< Associated matrix73 psVector *vector; ///< Assoicated vector74 pmStampStatus status; ///< Status ofstamp76 psImage *matrix; ///< Associated matrix 77 psVector *vector; ///< Assoicated vector 78 pmStampStatus status; ///< Status ofstamp 75 79 } 76 80 pmStamp; 77 81 78 psArray *pmSubtractionFindStamps(psArray *stamps, ///< Output stamps, or NULL 79 const psImage *image, ///< Image for which to find stamps 80 const psImage *mask, ///< Mask 81 psU32 maskVal, ///< Value for mask 82 psF32 threshold, ///< Threshold for stamps in the image 83 psS32 xNum, ///< Number of stamps in x 84 psS32 yNum, ///< Number of stamps in y 85 psS32 border ///< Border around image to ignore (should be size of kernel) 86 ); 82 psArray *pmSubtractionFindStamps( 83 psArray *stamps, ///< Output stamps, or NULL 84 const psImage *image, ///< Image for which to find stamps 85 const psImage *mask, ///< Mask 86 psU32 maskVal, ///< Value for mask 87 psF32 threshold, ///< Threshold for stamps in the image 88 psS32 xNum, ///< Number of stamps in x 89 psS32 yNum, ///< Number of stamps in y 90 psS32 border ///< Border around image to ignore (should be size of kernel) 91 ); 87 92 88 bool pmSubtractionCalculateEquation(psArray *stamps, ///< The stamps for which to calculate the equation, 89 const psImage *reference, ///< Reference image 90 const psImage *input, ///< Input image 91 const psSubtractionKernels *kernels, ///< The kernel basis functions 92 psS32 footprint ///< Half-size of region over which to calculate equation 93 ); 93 bool pmSubtractionCalculateEquation( 94 psArray *stamps, ///< The stamps for which to calculate the equation, 95 const psImage *reference, ///< Reference image 96 const psImage *input, ///< Input image 97 const psSubtractionKernels *kernels,///< The kernel basis functions 98 psS32 footprint ///< Half-size of region over which to calculate equation 99 ); 94 100 95 101 96 psVector *pmSubtractionSolveEquation(psVector *solution, ///< Solution vector, or NULL 97 const psArray *stamps ///< Array of stamps 98 ); 102 psVector *pmSubtractionSolveEquation( 103 psVector *solution, ///< Solution vector, or NULL 104 const psArray *stamps ///< Array of stamps 105 ); 99 106 100 bool pmSubtractionRejectStamps(psArray *stamps, ///< Array of stamps to check for rejection 101 psImage *mask, ///< Mask image 102 psU32 badStampMaskVal, ///< Value to use in mask for bad stamp 103 psS32 footprint, ///< Region to mask if stamp is bad 104 psF32 sigmaRej, ///< Number of RMS deviations above zero at which to reject 105 const psImage *refImage, ///< Reference image 106 const psImage *inImage, ///< Input image 107 const psVector *solution, ///< Solution vector 108 const psSubtractionKernels *kernels ///< Array of kernel parameters 109 ); 107 bool pmSubtractionRejectStamps( 108 psArray *stamps, ///< Array of stamps to check for rejection 109 psImage *mask, ///< Mask image 110 psU32 badStampMaskVal, ///< Value to use in mask for bad stamp 111 psS32 footprint, ///< Region to mask if stamp is bad 112 psF32 sigmaRej, ///< Number of RMS deviations above zero at which to reject 113 const psImage *refImage, ///< Reference image 114 const psImage *inImage, ///< Input image 115 const psVector *solution, ///< Solution vector 116 const psSubtractionKernels *kernels ///< Array of kernel parameters 117 ); 110 118 111 psImage *pmSubtractionKernelImage(psImage *out, 112 const psVector *solution, 113 const psSubtractionKernels *kernels, 114 psF32 x, 115 psF32 y 116 ); 119 psImage *pmSubtractionKernelImage( 120 psImage *out, 121 const psVector *solution, 122 const psSubtractionKernels *kernels, 123 psF32 x, 124 psF32 y 125 ); 117 126 118 127 #endif -
trunk/psModules/src/pmObjects.c
r4770 r4992 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 8-16 01:10:34$8 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-09-11 22:25:39 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 491 491 492 492 // XXX: Macro this. 493 static bool isItInThisRegion(const psRegion *valid,493 static bool isItInThisRegion(const psRegion valid, 494 494 psS32 x, 495 495 psS32 y) 496 496 { 497 497 498 if ((x >= valid ->x0) &&499 (x <= valid ->x1) &&500 (y >= valid ->y0) &&501 (y <= valid ->y1)) {498 if ((x >= valid.x0) && 499 (x <= valid.x1) && 500 (y >= valid.y0) && 501 (y <= valid.y1)) { 502 502 return(true); 503 503 } … … 519 519 psList *pmCullPeaks(psList *peaks, 520 520 psF32 maxValue, 521 const psRegion *valid)521 const psRegion valid) 522 522 { 523 523 PS_ASSERT_PTR_NON_NULL(peaks, NULL); … … 531 531 pmPeak *tmpPeak = (pmPeak *) tmpListElem->data; 532 532 if ((tmpPeak->counts > maxValue) || 533 ((valid != NULL) && 534 (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y)))) { 533 (true == isItInThisRegion(valid, tmpPeak->x, tmpPeak->y))) { 535 534 psListRemoveData(peaks, (psPtr) tmpPeak); 536 535 } … … 545 544 // XXX EAM: I changed this to return a new, subset array 546 545 // rather than alter the existing one 547 psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion *valid)546 psArray *pmPeaksSubset(psArray *peaks, psF32 maxValue, const psRegion valid) 548 547 { 549 548 PS_ASSERT_PTR_NON_NULL(peaks, NULL); … … 558 557 if (tmpPeak->counts > maxValue) 559 558 continue; 560 if (valid != NULL) { 561 if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y)) 562 continue; 563 } 559 if (isItInThisRegion(valid, tmpPeak->x, tmpPeak->y)) 560 continue; 564 561 psArrayAdd (output, 200, tmpPeak); 565 562 } -
trunk/psModules/src/pmObjects.h
r4770 r4992 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 8-16 01:10:34$7 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-09-11 22:25:39 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 /** pmPeak data structure 43 43 * 44 *45 *46 44 */ 47 45 typedef struct … … 55 53 56 54 /** pmMoments data structure 57 *58 *59 55 * 60 56 */ … … 75 71 /** pmModelType enumeration 76 72 * 77 *78 *79 73 */ 80 74 typedef enum { … … 89 83 90 84 /** pmModel data structure 91 *92 *93 85 * 94 86 */ … … 194 186 psList *peaks, ///< The psList of peaks to be culled 195 187 float maxValue, ///< Cull peaks above this value 196 const psRegion *valid ///< Cull peaks otside this psRegion188 const psRegion valid ///< Cull peaks otside this psRegion 197 189 ); 198 190 … … 399 391 pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type); 400 392 pmModelRadius pmModelRadius_GetFunction (pmModelType type); 393 psS32 pmModelParameterCount(pmModelType type); 394 psS32 pmModelSetType(char *name); 395 char *pmModelGetType(pmModelType type); 401 396 402 397 #endif -
trunk/psModules/src/pmReadoutCombine.c
r4770 r4992 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 8-16 01:10:34$7 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-09-11 22:25:39 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 102 102 PS_ASSERT_READOUT_NON_EMPTY(tmpReadout, output); 103 103 PS_ASSERT_READOUT_TYPE(tmpReadout, PS_TYPE_F32, output); 104 104 105 outputType = tmpReadout->image->type.type; 105 106 … … 242 243 // At this point, we have scanned all input readouts for this 243 244 // one output pixel. 245 // for (psS32 r = 0; r < numInputs ; r++) printf("(0)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]); 244 246 245 247 // Determine how many pixels lie between fracLow and fracHigh. … … 311 313 } 312 314 // Calculate the specified statistic on the stack of pixels. 315 // for (psS32 r = 0; r < numInputs ; r++) printf("(1)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]); 313 316 psStats *rc = psVectorStats(stats, 314 317 tmpPixels, … … 335 338 336 339 // Calculate the specified statistic on the stack of pixels. 340 // for (psS32 r = 0; r < numInputs ; r++) printf("(2)tmpPixels->data.F32[%d] is %f\n", r, tmpPixels->data.F32[r]); 337 341 psStats *rc = psVectorStats(stats, 338 342 tmpPixels, -
trunk/psModules/test/Makefile.am
r4219 r4992 12 12 tst_pmImageSubtract \ 13 13 tst_pmImageCombine \ 14 tst_pmObjects01 14 tst_pmObjects01 \ 15 tst_psAstrometry \ 16 tst_psAstrometry01 15 17 16 18 check_PROGRAMS = $(TESTS) … … 33 35 tst_pmImageCombine_SOURCES = tst_pmImageCombine.c 34 36 tst_pmObjects01_SOURCES = tst_pmObjects01.c 37 tst_psAstrometry_SOURCES = tst_psAstrometry.c 38 tst_psAstrometry01_SOURCES = tst_psAstrometry01.c 35 39 36 40 test: check -
trunk/psModules/test/tst_pmImageCombine.c
r4770 r4992 8 8 * 9 9 * XXX: Must verify the results internally. Don't use stdout file. 10 * 11 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-16 01:10:36 $ 10 * XXX: Must test masks with pmRejectPixels() 11 * 12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-11 22:25:39 $ 13 14 * 14 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 304 305 // 305 306 printf("\n\n\nCalling pmRejectPixels() with acceptable data. Should generate a psArray.\n"); 306 psArray *pixelRejects = pmRejectPixels(images, questionablePixels, expandTransforms,307 psArray *pixelRejects = pmRejectPixels(images, NULL, questionablePixels, expandTransforms, 307 308 contractTransforms, TST00_REJECTION_THRESHOLD, 308 309 TST00_GRADIENT_LIMIT); 309 310 if (pixelRejects == NULL) { 310 printf("TEST ERROR: pm CombineImages() returned a NULL psArray.\n");311 printf("TEST ERROR: pmRejectPixels() returned a NULL psArray.\n"); 311 312 testStatus = true; 312 313 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
