Changeset 8004 for trunk/psModules/src/detrend/pmSubtractSky.c
- Timestamp:
- Jul 27, 2006, 5:21:19 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmSubtractSky.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmSubtractSky.c
r7769 r8004 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 6-30 23:59:49 $8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-07-28 03:21:19 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 90 90 requirements change and we might need a custom reBin function. 91 91 *****************************************************************************/ 92 /* 92 #if 0 93 93 static psImage *binImage(psImage *origImage, 94 94 int binFactor, … … 96 96 { 97 97 psTrace("SubtractSky.binImage", 4, "Calling binImage(%d)\n", binFactor); 98 98 99 99 if (binFactor <= 0) { 100 100 psLogMsg(__func__, PS_LOG_WARN, … … 105 105 return(origImage); 106 106 } 107 107 108 108 psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32); 109 109 psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8); 110 110 psStats *myStats = psStatsAlloc(statOptions); 111 111 112 112 for (psS32 row = 0; row < origImage->numRows ; row+=binFactor) { 113 113 for (psS32 col = 0; col < origImage->numCols ; col+=binFactor) { … … 134 134 psF64 statValue; 135 135 psBool rc = p_psGetStatValue(rc1, &statValue); 136 136 137 137 if (rc == true) { 138 138 origImage->data.F32[row][col] = (psF32) statValue; … … 147 147 psFree(binMask); 148 148 psFree(myStats); 149 149 150 150 psTrace("SubtractSky.binImage", 4, "Exiting binImage(%d)\n", binFactor); 151 151 return(origImage); 152 152 } 153 */ 153 #endif 154 154 155 155 /****************************************************************************** … … 601 601 } else { 602 602 // Determine the mean and standard deviation of the binned image. 603 psF64 binnedMean; 604 psF64 binnedStdev; 605 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 606 psStats *rc = psImageStats(myStats, binnedImage, NULL, 0); 607 if (rc == NULL) { 608 psError(PS_ERR_UNKNOWN, false, "psImageStats(): could not perform requested statistical operation. Returning in image.\n"); 609 return(in); 610 } 611 if (false == p_psGetStatValue(rc, &binnedMean)) { 612 psError(PS_ERR_UNKNOWN, false, "p_psGetStatValue(): could not determine requested statistical operation. Returning in image.\n"); 613 return(in); 614 } 615 psTrace(".psModule.pmSubtractSky", 6, 616 "binned Mean is %f\n", binnedMean); 617 618 myStats->options = PS_STAT_SAMPLE_STDEV; 619 rc = psImageStats(myStats, binnedImage, NULL, 0); 620 if (rc == NULL) { 621 psError(PS_ERR_UNKNOWN, false, "psImageStats(): could not perform requested statistical operation. Returning in image.\n"); 622 return(in); 623 } 624 if (false == p_psGetStatValue(myStats, &binnedStdev)) { 625 psError(PS_ERR_UNKNOWN, false, "p_psGetStatValue(): could not determine requested statistical operation. Returning in image.\n"); 626 return(in); 627 } 603 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV); 604 if (!psImageStats(myStats, binnedImage, NULL, 0)) { 605 psError(PS_ERR_UNEXPECTED_NULL, false, "Couldn't get statistics for image.\n"); 606 return NULL; 607 } 608 psF64 binnedMean = myStats->sampleMean; 609 psF64 binnedStdev = myStats->sampleStdev; 628 610 psFree(myStats); 629 611 psTrace(".psModule.pmSubtractSky", 6,
Note:
See TracChangeset
for help on using the changeset viewer.
