Changeset 2587
- Timestamp:
- Dec 1, 2004, 11:39:30 AM (22 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 3 edited
-
Makefile.am (modified) (1 diff)
-
Makefile.in (modified) (4 diffs)
-
pmSubtractSky.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/Makefile.am
r2271 r2587 1 1 lib_LIBRARIES = libpsmodule.a 2 2 3 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c 4 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h 3 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c pmSubtractSky.c 4 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h pmSubtractSky.h 5 5 libpsmodule_adir = $(includedir) -
trunk/psModules/src/Makefile.in
r2271 r2587 96 96 lib_LIBRARIES = libpsmodule.a 97 97 98 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c 99 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h 98 libpsmodule_a_SOURCES = pmFlatField.c pmMaskBadPixels.c pmSubtractBias.c psTest.c pmSubtractBias.c pmNonLinear.c pmReadoutCombine.c pmSubtractSky.c 99 libpsmodule_a_HEADERS = pmFlatField.h pmMaskBadPixels.h pmSubtractBias.h psTest.h pmSubtractBias.h pmReadoutCombine.h pmSubtractSky.h 100 100 libpsmodule_adir = $(includedir) 101 101 subdir = src … … 110 110 pmMaskBadPixels.$(OBJEXT) pmSubtractBias.$(OBJEXT) \ 111 111 psTest.$(OBJEXT) pmSubtractBias.$(OBJEXT) pmNonLinear.$(OBJEXT) \ 112 pmReadoutCombine.$(OBJEXT) 112 pmReadoutCombine.$(OBJEXT) pmSubtractSky.$(OBJEXT) 113 113 libpsmodule_a_OBJECTS = $(am_libpsmodule_a_OBJECTS) 114 114 … … 124 124 @AMDEP_TRUE@ ./$(DEPDIR)/pmNonLinear.Po \ 125 125 @AMDEP_TRUE@ ./$(DEPDIR)/pmReadoutCombine.Po \ 126 @AMDEP_TRUE@ ./$(DEPDIR)/pmSubtractBias.Po ./$(DEPDIR)/psTest.Po 126 @AMDEP_TRUE@ ./$(DEPDIR)/pmSubtractBias.Po \ 127 @AMDEP_TRUE@ ./$(DEPDIR)/pmSubtractSky.Po ./$(DEPDIR)/psTest.Po 127 128 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 128 129 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) … … 212 213 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmReadoutCombine.Po@am__quote@ 213 214 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmSubtractBias.Po@am__quote@ 215 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmSubtractSky.Po@am__quote@ 214 216 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psTest.Po@am__quote@ 215 217 -
trunk/psModules/src/pmSubtractSky.c
r2586 r2587 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-12-01 21: 27:26$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-12-01 21:39:30 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 16 16 #include "pslib.h" 17 17 #include "psConstants.h" 18 19 typedef enum { 20 PM_FIT_NONE, ///< No fit 21 PM_FIT_POLYNOMIAL, ///< Fit polynomial 22 PM_FIT_SPLINE ///< Fit cubic splines 23 } pmFit; 18 24 19 25 int p_psDetermineNumBits(unsigned int data) … … 50 56 return(PS_STAT_ROBUST_MODE); 51 57 } 52 psError(XXX);58 // psError(XXX); 53 59 return(-1); 54 60 } … … 68 74 psVector *binVector = psVectorAlloc(binFactor * binFactor, PS_TYPE_F32); 69 75 psVector *binMask = psVectorAlloc(binFactor * binFactor, PS_TYPE_U8); 70 psStats *myStats = psStatsAlloc(statOptions) 71 72 if (binFactor <= 0) {73 psLogMsg(__func__, PS_LOG_WARN,74 "WARNING: binImage(): binFactor is %d\n", binFactor);75 return(origImage);76 }77 if (binFactor == 1) {78 return(origImage);79 }80 81 for (int row = 0; row < origImage->numRows ; row+=binFactor) {82 for (int col = 0; col < origImage->numCols ; col+=binFactor) {83 int count = 0;84 for (int binRow = 0; binRow <= binFactor ; binRow++) {85 for (int binCol = 0; binCol <= binFactor ; binCol++) {86 if (((row + binRow) < origImage->numRows) &&87 ((col + binCol) < origImage->numCol)) {88 binVector->data.F32[count] =89 origImage->data.F32[row + binRow][col + binCol];90 binMask->data.U8[count] = 0;91 } else {92 binVector->data.F32[count] = 0.0;93 binMask->data.U8[count] = 1;94 }95 count++;96 }97 }98 myStats = psVectorStats(myStats, binVector, binMask, 1);99 psF64 statValue;100 psBool rc = p_psGetStatValue(myStats, &statValue);101 102 if (rc == true) {103 origImage->data.F32[row][col] = (psF32) statValue;104 } else {105 origImage->data.F32[row][col] = 0.0;106 psLogMsg(__func__, PS_LOG_WARN,107 "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n");108 }109 }110 }111 psFree(myStats);76 psStats *myStats = psStatsAlloc(statOptions); 77 78 if (binFactor <= 0) { 79 psLogMsg(__func__, PS_LOG_WARN, 80 "WARNING: binImage(): binFactor is %d\n", binFactor); 81 return(origImage); 82 } 83 if (binFactor == 1) { 84 return(origImage); 85 } 86 87 for (int row = 0; row < origImage->numRows ; row+=binFactor) { 88 for (int col = 0; col < origImage->numCols ; col+=binFactor) { 89 int count = 0; 90 for (int binRow = 0; binRow <= binFactor ; binRow++) { 91 for (int binCol = 0; binCol <= binFactor ; binCol++) { 92 if (((row + binRow) < origImage->numRows) && 93 ((col + binCol) < origImage->numCol)) { 94 binVector->data.F32[count] = 95 origImage->data.F32[row + binRow][col + binCol]; 96 binMask->data.U8[count] = 0; 97 } else { 98 binVector->data.F32[count] = 0.0; 99 binMask->data.U8[count] = 1; 100 } 101 count++; 102 } 103 } 104 myStats = psVectorStats(myStats, binVector, binMask, 1); 105 psF64 statValue; 106 psBool rc = p_psGetStatValue(myStats, &statValue); 107 108 if (rc == true) { 109 origImage->data.F32[row][col] = (psF32) statValue; 110 } else { 111 origImage->data.F32[row][col] = 0.0; 112 psLogMsg(__func__, PS_LOG_WARN, 113 "WARNING: pmSubtractSky(), binImage(): p_psGetStatValue() was FALSE\n"); 114 } 115 } 116 } 117 psFree(myStats); 112 118 psFree(binVector); 113 119 psFree(binMask);
Note:
See TracChangeset
for help on using the changeset viewer.
