Changeset 4526
- Timestamp:
- Jul 8, 2005, 3:24:30 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
pslib.kdevses (modified) (1 diff)
-
src/dataIO/psDB.h (modified) (18 diffs)
-
src/dataManip/psStats.c (modified) (10 diffs)
-
src/dataManip/psStats.h (modified) (5 diffs)
-
src/image/psImage.c (modified) (3 diffs)
-
src/image/psImage.h (modified) (6 diffs)
-
src/image/psImageStructManip.c (modified) (4 diffs)
-
src/sysUtils/psType.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r4493 r4526 3 3 <KDevPrjSession> 4 4 <DocsAndViews NumberOfDocuments="5" > 5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ sysUtils/psType.h" >6 <View0 line=" 296" Type="Source" />5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.h" > 6 <View0 line="53" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ collections/psVector.h" >9 <View0 line="1 02" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.c" > 9 <View0 line="150" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/ src/collections/psVector.c" >12 <View0 line=" 130" Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/test/image/tst_psImageStructManip.c" > 12 <View0 line="39" Type="Source" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ image/psImage.h" >15 <View0 line=" 149" Type="Source" />14 <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataIO/psDB.h" > 15 <View0 line="22" Type="Source" /> 16 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ image/psImage.c" >18 <View0 line=" 151" Type="Source" />17 <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/dataIO/psFits.h" > 18 <View0 line="259" Type="Source" /> 19 19 </Doc4> 20 20 </DocsAndViews> -
trunk/psLib/src/dataIO/psDB.h
r4429 r4526 10 10 * @author Joshua Hoblitt 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 6-29 19:43:55$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-09 01:24:30 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 34 34 typedef struct 35 35 { 36 void* mysql; ///< MySQL database handle36 void* mysql; ///< MySQL database handle 37 37 } 38 38 psDB; … … 44 44 */ 45 45 psDB *psDBInit( 46 const char *host, ///< Database server hostname47 const char *user, ///< Database username48 const char *passwd, ///< Database password49 const char *dbname ///< Database namespace46 const char *host, ///< Database server hostname 47 const char *user, ///< Database username 48 const char *passwd, ///< Database password 49 const char *dbname ///< Database namespace 50 50 ); 51 51 … … 53 53 */ 54 54 void psDBCleanup( 55 psDB *dbh ///< Database handle55 psDB *dbh ///< Database handle 56 56 ); 57 57 … … 61 61 */ 62 62 bool psDBCreate( 63 psDB *dbh, ///< Database handle64 const char *dbname ///< New database namespace63 psDB *dbh, ///< Database handle 64 const char *dbname ///< New database namespace 65 65 ); 66 66 … … 70 70 */ 71 71 bool psDBChange( 72 psDB *dbh, ///< Database handle73 const char *dbname ///< Database namespace72 psDB *dbh, ///< Database handle 73 const char *dbname ///< Database namespace 74 74 ); 75 75 … … 79 79 */ 80 80 bool psDBDrop( 81 psDB *dbh, ///< Database handle82 const char *dbname ///< Database namespace81 psDB *dbh, ///< Database handle 82 const char *dbname ///< Database namespace 83 83 ); 84 84 … … 92 92 */ 93 93 bool p_psDBRunQuery( 94 psDB *dbh, ///< Database handle95 const char *format ///< SQL string to execute94 psDB *dbh, ///< Database handle 95 const char *format ///< SQL string to execute 96 96 ); 97 97 … … 117 117 */ 118 118 bool psDBCreateTable( 119 psDB *dbh, ///< Database handle120 const char *tableName, ///< Table name121 const psMetadata *md ///< Column names, types, and indexes119 psDB *dbh, ///< Database handle 120 const char *tableName, ///< Table name 121 const psMetadata *md ///< Column names, types, and indexes 122 122 ); 123 123 … … 140 140 */ 141 141 psArray *psDBSelectColumn( 142 psDB *dbh, ///< Database handle143 const char *tableName, ///< Table name144 const char *col, ///< Column name145 unsigned long long limit ///< Maximum number of elements to return142 psDB *dbh, ///< Database handle 143 const char *tableName, ///< Table name 144 const char *col, ///< Column name 145 unsigned long long limit ///< Maximum number of elements to return 146 146 ); 147 147 … … 155 155 */ 156 156 psVector *psDBSelectColumnNum( 157 psDB *dbh, ///< Database handle158 const char *tableName, ///< Table name159 const char *col, ///< Column name157 psDB *dbh, ///< Database handle 158 const char *tableName, ///< Table name 159 const char *col, ///< Column name 160 160 psElemType type, ///< Resulting psVector type 161 unsigned long long limit ///< Maximum number of elements to return161 unsigned long long limit ///< Maximum number of elements to return 162 162 ); 163 163 … … 177 177 */ 178 178 psArray *psDBSelectRows( 179 psDB *dbh, ///< Database handle180 const char *tableName, ///< Table name181 const psMetadata *where, ///< Row match criteria182 unsigned long long limit ///< Maximum number of elements to return179 psDB *dbh, ///< Database handle 180 const char *tableName, ///< Table name 181 const psMetadata *where, ///< Row match criteria 182 unsigned long long limit ///< Maximum number of elements to return 183 183 ); 184 184 … … 195 195 */ 196 196 bool psDBInsertOneRow( 197 psDB *dbh, ///< Database handle198 const char *tableName, ///< Table name199 const psMetadata *row ///< Row description197 psDB *dbh, ///< Database handle 198 const char *tableName, ///< Table name 199 const psMetadata *row ///< Row description 200 200 ); 201 201 … … 210 210 */ 211 211 bool psDBInsertRows( 212 psDB *dbh, ///< Database handle213 const char *tableName, ///< Table name214 const psArray *rowSet ///< Set of rows to insert212 psDB *dbh, ///< Database handle 213 const char *tableName, ///< Table name 214 const psArray *rowSet ///< Set of rows to insert 215 215 ); 216 216 … … 223 223 */ 224 224 psArray *psDBDumpRows( 225 psDB *dbh, ///< Database handle226 const char *tableName ///< Table name225 psDB *dbh, ///< Database handle 226 const char *tableName ///< Table name 227 227 ); 228 228 … … 236 236 */ 237 237 psMetadata *psDBDumpCols( 238 psDB *dbh, ///< Database handle239 const char *tableName ///< Table name238 psDB *dbh, ///< Database handle 239 const char *tableName ///< Table name 240 240 ); 241 241 … … 252 252 */ 253 253 psS64 psDBUpdateRows( 254 psDB *dbh, ///< Database handle255 const char *tableName, ///< Table name256 const psMetadata *where, ///< Row match criteria257 const psMetadata *values ///< new field values254 psDB *dbh, ///< Database handle 255 const char *tableName, ///< Table name 256 const psMetadata *where, ///< Row match criteria 257 const psMetadata *values ///< new field values 258 258 ); 259 259 … … 269 269 */ 270 270 psS64 psDBDeleteRows( 271 psDB *dbh, ///< Database handle272 const char *tableName, ///< Table name273 const psMetadata *where, ///< Row match criteria274 unsigned long long limit ///< Maximum number of rows to delete271 psDB *dbh, ///< Database handle 272 const char *tableName, ///< Table name 273 const psMetadata *where, ///< Row match criteria 274 unsigned long long limit ///< Maximum number of rows to delete 275 275 ); 276 276 -
trunk/psLib/src/dataManip/psStats.c
r4409 r4526 14 14 * stats->binsize 15 15 * 16 * @version $Revision: 1.13 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 6-28 20:17:52$16 * @version $Revision: 1.137 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-07-09 01:24:30 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 77 77 psBool p_psGetStatValue(const psStats* stats, psF64 *value) 78 78 { 79 switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) { 79 // switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) { 80 switch (stats->options & ~(PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE)) { 80 81 case PS_STAT_SAMPLE_MEAN: 81 82 *value = stats->sampleMean; … … 658 659 x.data.F32 = iMid - (PS_GAUSS_WIDTH * sigma); 659 660 if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) { 660 jMin = p_psVectorBinDisect( robustHistogram->bounds, &x);661 jMin = p_psVectorBinDisect( *(psVector* *)&robustHistogram->bounds, &x); 661 662 if (jMin < 0) { 662 663 psError(PS_ERR_UNEXPECTED_NULL, … … 673 674 x.data.F32 = iMid + (PS_GAUSS_WIDTH * sigma); 674 675 if ((x.data.F32 >= firstBound) && (x.data.F32 <= lastBound)) { 675 jMax = p_psVectorBinDisect( robustHistogram->bounds, &x);676 jMax = p_psVectorBinDisect( *(psVector* *)&robustHistogram->bounds, &x); 676 677 if (jMax < 0) { 677 678 psError(PS_ERR_UNEXPECTED_NULL, … … 1705 1706 //Determine id that is okay. 1706 1707 stats->robustMedian = fitQuadraticSearchForYThenReturnX( 1707 robustHistogram->bounds,1708 *(psVector* *)&robustHistogram->bounds, 1708 1709 cumulativeRobustSums, 1709 1710 medianBinNum, … … 1721 1722 //Determine id that is okay. 1722 1723 stats->robustLQ = fitQuadraticSearchForYThenReturnX( 1723 robustHistogram->bounds,1724 *(psVector* *)&robustHistogram->bounds, 1724 1725 cumulativeRobustSums, 1725 1726 LQBinNum, … … 1728 1729 //Determine id that is okay. 1729 1730 stats->robustUQ = fitQuadraticSearchForYThenReturnX( 1730 robustHistogram->bounds,1731 *(psVector* *)&robustHistogram->bounds, 1731 1732 cumulativeRobustSums, 1732 1733 UQBinNum, … … 1812 1813 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 1813 1814 newHist->bounds = psVectorAlloc(n + 1, PS_TYPE_F32); 1814 newHist->bounds->n = newHist->bounds->nalloc;1815 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 1815 1816 1816 1817 // Calculate the bounds for each bin. … … 1859 1860 psMemSetDeallocator(newHist, (psFreeFunc) histogramFree); 1860 1861 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 1861 newHist->bounds->n = newHist->bounds->nalloc;1862 *(int *)&newHist->bounds->n = newHist->bounds->nalloc; 1862 1863 for (i = 0; i < bounds->n; i++) { 1863 1864 newHist->bounds->data.F32[i] = bounds->data.F32[i]; … … 2067 2068 // correct bin number requires a bit more work. 2068 2069 tmpScalar.data.F32 = inF32->data.F32[i]; 2069 binNum = p_psVectorBinDisect( out->bounds, &tmpScalar);2070 binNum = p_psVectorBinDisect( *(psVector* *)&out->bounds, &tmpScalar); 2070 2071 if (binNum < 0) { 2071 2072 psLogMsg(__func__, PS_LOG_WARN, -
trunk/psLib/src/dataManip/psStats.h
r4409 r4526 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 6-28 20:17:52$16 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-07-09 01:24:30 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 52 52 PS_STAT_USE_RANGE = 0x002000, ///< Range 53 53 PS_STAT_USE_BINSIZE = 0x004000, ///< Binsize 54 PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 ///< Robust for sample54 // PS_STAT_ROBUST_FOR_SAMPLE = 0x008000 ///< Robust for sample 55 55 } psStatsOptions; 56 56 … … 60 60 typedef struct 61 61 { 62 psF64 sampleMean;///< formal mean of sample63 psF64 sampleMedian;///< formal median of sample64 psF64 sampleStdev;///< standard deviation of sample65 psF64 sampleUQ;///< upper quartile of sample66 psF64 sampleLQ;///< lower quartile of sample67 psF64 robustMean;///< robust mean of array68 psF64 robustMedian;///< robust median of array69 psF64 robustMode;///< Robust mode of array70 psF64 robustStdev;///< robust standard deviation of array71 psF64 robustUQ;///< robust upper quartile72 psF64 robustLQ;///< robust lower quartile73 psS32 robustN50;///< Number of points in Gaussian fit. XXX: This is currently never set.74 psS32 robustNfit;///< The number of points between the quartiles.75 psF64 clippedMean;///< Nsigma clipped mean76 psF64 clippedStdev;///< standard deviation after clipping77 psS32 clippedNvalues;///< Number of data points used for clipped mean: This value is never used.78 psF64 clipSigma;///< Nsigma used for clipping; user input79 psS32 clipIter;///< Number of clipping iterations; user input80 psF64 min;///< minimum data value in array81 psF64 max;///< maximum data value in array82 psF64 binsize;///< binsize for robust fit (input/ouput)83 psStatsOptions options; ///< bitmask of calculated values62 double sampleMean; ///< formal mean of sample 63 double sampleMedian; ///< formal median of sample 64 double sampleStdev; ///< standard deviation of sample 65 double sampleUQ; ///< upper quartile of sample 66 double sampleLQ; ///< lower quartile of sample 67 double robustMean; ///< robust mean of array 68 double robustMedian; ///< robust median of array 69 double robustMode; ///< Robust mode of array 70 double robustStdev; ///< robust standard deviation of array 71 double robustUQ; ///< robust upper quartile 72 double robustLQ; ///< robust lower quartile 73 int robustN50; ///< Number of points in Gaussian fit. XXX: This is currently never set. 74 int robustNfit; ///< The number of points between the quartiles. 75 double clippedMean; ///< Nsigma clipped mean 76 double clippedStdev; ///< standard deviation after clipping 77 int clippedNvalues; ///< Number of data points used for clipped mean: This value is never used. 78 double clipSigma; ///< Nsigma used for clipping; user input 79 int clipIter; ///< Number of clipping iterations; user input 80 double min; ///< minimum data value in array 81 double max; ///< maximum data value in array 82 double binsize; ///< binsize for robust fit (input/ouput) 83 psStatsOptions options; ///< bitmask of calculated values 84 84 } 85 85 psStats; … … 90 90 */ 91 91 psStats* psVectorStats( 92 psStats* stats, ///< stats structure defines stats to be calculated and how93 const psVector* in, ///< Vector to be analysed.94 const psVector* errors, ///< Errors.95 const psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL96 psMaskType maskVal ///< Only mask elements with one of these bits set in maskVector92 psStats* stats, ///< stats structure defines stats to be calculated and how 93 const psVector* in, ///< Vector to be analysed. 94 const psVector* errors, ///< Errors. 95 const psVector* mask, ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL 96 psMaskType maskVal ///< Only mask elements with one of these bits set in maskVector 97 97 ); 98 98 … … 121 121 typedef struct 122 122 { 123 psVector* bounds;///< Bounds for the bins (type F32)123 const psVector* bounds; ///< Bounds for the bins (type F32) 124 124 psVector* nums; ///< Number in each of the bins (INT) 125 psS32 minNum;///< Number below the minimum126 psS32 maxNum;///< Number above the maximum127 psBool uniform;///< Is it a uniform distribution?125 int minNum; ///< Number below the minimum 126 int maxNum; ///< Number above the maximum 127 bool uniform; ///< Is it a uniform distribution? 128 128 } 129 129 psHistogram; -
trunk/psLib/src/image/psImage.c
r4493 r4526 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-07-0 7 02:17:53$11 * @version $Revision: 1.74 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-09 01:24:30 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 48 48 } 49 49 50 psImage* psImageAlloc( psU32numCols,51 psU32numRows,50 psImage* psImageAlloc(int numCols, 51 int numRows, 52 52 psElemType type) 53 53 { … … 149 149 150 150 psImage* psImageRecycle(psImage* old, 151 psU32numCols,152 psU32numRows,151 int numCols, 152 int numRows, 153 153 const psElemType type) 154 154 { -
trunk/psLib/src/image/psImage.h
r4493 r4526 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-07-0 7 02:17:53$13 * @version $Revision: 1.61 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-09 01:24:30 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 typedef struct psImage 52 52 { 53 const psMathType type; ///< Image data type and dimension.54 const psU32 numCols;///< Number of columns in image55 const psU32 numRows;///< Number of rows in image.56 const psS32 col0;///< Column position relative to parent.57 const psS32 row0;///< Row position relative to parent.53 const psMathType type; ///< Image data type and dimension. 54 const int numCols; ///< Number of columns in image 55 const int numRows; ///< Number of rows in image. 56 const int col0; ///< Column position relative to parent. 57 const int row0; ///< Row position relative to parent. 58 58 59 59 union { … … 77 77 78 78 psPtr rawDataBuffer; ///< Raw data buffer for Allocating/Freeing Images 79 void *lock; ///< Optional lock for thread safety 79 80 } 80 81 psImage; … … 103 104 */ 104 105 psImage* psImageAlloc( 105 psU32 numCols,///< Number of rows in image.106 psU32 numRows,///< Number of columns in image.106 int numCols, ///< Number of rows in image. 107 int numRows, ///< Number of columns in image. 107 108 psElemType type ///< Type of data for image. 108 ); 109 ) 110 ; 109 111 110 112 /** Create a psRegion with the specified attributes. … … 113 115 */ 114 116 psRegion psRegionSet( 115 float x0, ///< the first column of the region.116 float x1, ///< the last column of the region + 1.117 float y0, ///< the first row of the region.118 float y1 ///< the last row of the region + 1.117 float x0, ///< the first column of the region. 118 float x1, ///< the last column of the region + 1. 119 float y0, ///< the first row of the region. 120 float y1 ///< the last row of the region + 1. 119 121 ); 120 122 … … 146 148 psImage* psImageRecycle( 147 149 psImage* old, ///< the psImage to recycle by resizing image buffer 148 psU32 numCols,///< the desired number of columns in image149 psU32 numRows,///< the desired number of rows in image150 int numCols, ///< the desired number of columns in image 151 int numRows, ///< the desired number of rows in image 150 152 const psElemType type ///< the desired datatype of the image 151 153 ); -
trunk/psLib/src/image/psImageStructManip.c
r4493 r4526 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-07-0 7 02:17:53$10 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-09 01:24:30 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 31 31 { 32 32 psU32 elementSize; // size of image element in bytes 33 psU32 inputColOffset; // offset in bytes to first subset pixel in input row 33 psS32 inputColOffset; // offset in bytes to first subset pixel in input row 34 35 if ( col0 < 0 || row0 < 0 ) { 36 // psError(PS_ERR_BAD_PARAMETER_VALUE, true, 37 // PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID); 38 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 39 PS_ERRORTEXT_psImage_SUBSET_RANGE_INVALID, 40 col0, col1-1, row0, row1-1, 41 image->numCols-1, image->numRows-1); 42 return NULL; 43 } 34 44 35 45 if (image == NULL || image->data.V == NULL) { … … 64 74 return NULL; 65 75 } 76 77 78 66 79 psS32 numRows = row1-row0; 67 80 psS32 numCols = col1-col0; … … 95 108 out->data.V = psRealloc(out->data.V,sizeof(psPtr)*numRows); // resize row pointer array 96 109 *(psMathType*)&out->type = image->type; 97 *(psU32*)&out->numCols = numCols; 98 *(psU32*)&out->numRows = numRows; 110 // *(psU32*)&out->numCols = numCols; 111 // *(psU32*)&out->numRows = numRows; 112 *(psS32*)&out->numCols = numCols; 113 *(psS32*)&out->numRows = numRows; 99 114 *(psS32*)&out->row0 = row0; 100 115 *(psS32*)&out->col0 = col0; -
trunk/psLib/src/sysUtils/psType.h
r4493 r4526 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07-0 7 02:17:53$12 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-09 01:24:30 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
Note:
See TracChangeset
for help on using the changeset viewer.
