Changeset 12742 for trunk/psModules/src/detrend/pmSkySubtract.c
- Timestamp:
- Apr 4, 2007, 12:42:48 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmSkySubtract.c (modified) (10 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 }
Note:
See TracChangeset
for help on using the changeset viewer.
