Changeset 12742
- Timestamp:
- Apr 4, 2007, 12:42:48 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 edited
-
detrend/pmSkySubtract.c (modified) (10 diffs)
-
imcombine/pmImageCombine.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmSkySubtract.c
r12696 r12742 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 3-30 21:12:56$8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-04-04 22:42:48 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 DetermineNumBits(data): This routine takes an enum psStatsOptions as an 36 36 argument and returns the number of non-zero bits. 37 37 38 38 XXX: This code is duplicated in the ReadoutCombine file. 39 39 *****************************************************************************/ … … 91 91 input psImage and scales it smaller by a factor of binFactor. The statistic 92 92 used in combining input pixels is specified in statOptions. 93 93 94 94 XXX: use static vectors for myStats, binVector and binMask. 95 95 XXX: I coded this before I was aware of a psLib reBin function. I don't … … 163 163 CalculatePolyTerms(xOrder, yOrder): this routine will calculate the number of 164 164 coefficients (or terms) in a 2-D polynomial of order (xOrder, yOrder). 165 165 166 166 XXX: Use your brain and figure out the analytical expression. 167 167 168 168 XXX: Why isn't it simply (xOrder+1) * (yOrder+1)? 169 169 *****************************************************************************/ … … 199 199 polyTerms[i][0] = the power to which X is raised in the i-th term of in an 200 200 poly-order sky background polynomial. 201 201 202 202 polyTerms[i][1] = the power to which Y is raised in the i-th term of in an 203 203 poly-order sky background polynomial. … … 248 248 This procedure calculates various combinations of powers of x and y and stores 249 249 them in the data structure p_psPolySums[][]. After it completes: 250 250 251 251 p_psPolySums[i][j] == x^i * y^j 252 252 253 253 XXX: Use a psImage for the p_psPolySums data structure? 254 254 XXX: p_psPolySums: should this be a global? Did you get the storage classifier … … 296 296 used in this routine is based on that of the pilot project ADD, but is not 297 297 documented anywhere. 298 298 299 299 XXX: Different trace message facilities in use here. 300 300 *****************************************************************************/ … … 471 471 /****************************************************************************** 472 472 pmReadout pmSubtractSky(): 473 473 474 474 XXX: use static vectors for myStats, and the binned image 475 475 476 476 XXX: The SDR is silent about types. PS_TYPE_F32 is implemented here. 477 477 478 478 XXX: Sync the psTrace message facilities. 479 479 *****************************************************************************/ … … 691 691 } 692 692 } else { 693 694 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, 695 binnedImage, NULL, NULL, 0, 696 0.0, 0.0, 0, 0, 0.0); 697 693 698 for (psS32 row = 0; row < trimmedImg->numRows ; row++) { 694 699 for (psS32 col = 0; col < trimmedImg->numCols ; col++) { … … 705 710 binColF64+= 0.5; 706 711 707 psF32 binPixel = (psF32) psImagePixelInterpolate( 708 binnedImage, binColF64, binRowF64, 709 NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 710 trimmedImg->data.F32[row][col]-= binPixel; 712 double binPixel; 713 if (!psImagePixelInterpolate(&binPixel, NULL, NULL, binColF64, binRowF64, interp)) { 714 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); 715 psFree(interp); 716 psFree(binnedImage); 717 return NULL; 718 } 719 trimmedImg->data.F32[row][col] -= binPixel; 711 720 712 721 psTrace("psModules.detrend", 8, 713 "image[%d][%d] <--> binnedImage[%.2f][%.2f]: % f\n",722 "image[%d][%d] <--> binnedImage[%.2f][%.2f]: %lf\n", 714 723 row, col, binRowF64-0.5, binColF64-0.5, binPixel); 715 724 } 716 725 } 726 psFree(interp); 717 727 718 728 } -
trunk/psModules/src/imcombine/pmImageCombine.c
r11115 r12742 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2007-0 1-16 23:51:51$10 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2007-04-04 22:42:48 $ 12 12 * 13 13 * XXX: pmRejectPixels() has a known bug with the pmImageTransform() call. … … 375 375 image, this routine determines the size of the input image which maps to that 376 376 image, and returns the result in a psRegion struct. 377 377 378 378 XXX: Basically, this routine is only guaranteed to work if the transform is 379 379 linear. 380 380 381 381 XXX: Shouldn't this functionality be part of psImageTransform()? 382 382 *****************************************************************************/ … … 491 491 pmRejectPixels(images, errors, inToOut, outToIn, rejThreshold, 492 492 gradLimit) 493 493 494 494 XXX: Optimization: we don't need to transform the entire mask image. 495 495 XXX: The inToOut and outToIn transforms are confusing. Verify that what … … 591 591 // in other images. 592 592 // 593 594 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR, 595 transformedImage, NULL, NULL, 596 0, 0.0, 0.0, 0, 0, 0.0); 597 593 598 for (psS32 p = 0 ; p < pixelList->n ; p++) { 594 599 inCoords->x = 0.5 + (psF32) (pixelList->data[p]).x; 595 600 inCoords->y = 0.5 + (psF32) (pixelList->data[p]).y; 596 601 psPlaneTransformApply(outCoords, myInToOut, inCoords); 597 psF32 maskVal = (psF32) psImagePixelInterpolate(transformedImage, outCoords->x, outCoords->y, 598 NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR); 602 double maskVal; 603 if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) { 604 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image."); 605 psFree(interp); 606 psFree(maskImage); 607 psFree(maskImageF32); 608 psFree(transformedImage); 609 psFree(inCoords); 610 psFree(outCoords); 611 psFree(rejects); 612 return NULL; 613 } 599 614 if (maskVal > rejThreshold) { 600 615 … … 656 671 } 657 672 673 psFree(interp); 658 674 psFree(maskImage); 659 675 psFree(maskImageF32);
Note:
See TracChangeset
for help on using the changeset viewer.
