Changeset 6859 for branches/rel10_ifa/psModules/src/pslib
- Timestamp:
- Apr 14, 2006, 11:43:59 AM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src/pslib
- Files:
-
- 4 edited
-
psAdditionals.c (modified) (2 diffs)
-
psAdditionals.h (modified) (1 diff)
-
psImageUnbin.c (modified) (4 diffs)
-
psImageUnbin.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/pslib/psAdditionals.c
r6725 r6859 143 143 { 144 144 psList *values = psListAlloc(NULL); // The list of values to return 145 if (string == NULL) 146 return values; // NULL string is not an error, just an empty list 147 145 148 unsigned int length = strlen(string); // The length of the string 146 149 unsigned int numSplitters = strlen(splitters); // Number of characters that might split … … 176 179 } 177 180 181 psArray *psStringSplitArray (const char *string, const char *splitters) 182 { 183 184 psList *list = psStringSplit (string, splitters); 185 psArray *array = psListToArray (list); 186 psFree (list); 187 return array; 188 } 189 178 190 #ifndef whitespace 179 191 #define whitespace(c) (((c) == ' ') || ((c) == '\t')) -
branches/rel10_ifa/psModules/src/pslib/psAdditionals.h
r6848 r6859 30 30 ); 31 31 32 // Split string on given characters 33 psArray *psStringSplitArray(const char *string, // String to split 34 const char *splitters // Characters on which to split 35 ); 36 32 37 // strip whitespace from head and tail of string 33 38 int psStringStrip (char *string); -
branches/rel10_ifa/psModules/src/pslib/psImageUnbin.c
r6826 r6859 179 179 } 180 180 181 doublepsImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax)181 psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax) 182 182 { 183 183 double value; … … 185 185 int ny = image->numRows; 186 186 187 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_QUARTILE); 187 188 if (nx*ny <= 0) 188 return 0.0;189 return stats; 189 190 190 191 int Nsubset = PS_MIN (MAX_SAMPLE_PIXELS, nx*ny); … … 203 204 int iy = pixel / nx; 204 205 205 if (mask ->data.U8[iy][ix] & maskValue)206 if (mask && mask->data.U8[iy][ix] & maskValue) 206 207 continue; 207 208 … … 226 227 value = value / npts; 227 228 229 stats->robustMedian = value; 230 stats->robustUQ = values->data.F32[imax]; 231 stats->robustLQ = values->data.F32[imin]; 232 233 psFree (values); 234 return stats; 228 235 // XXX correct for selection bias?? 229 230 psFree (values);231 return value;232 236 } 233 237 -
branches/rel10_ifa/psModules/src/pslib/psImageUnbin.h
r6826 r6859 11 11 12 12 // my temporary image stats function; seems to be much faster than psLib??? 13 doublepsImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax);13 psStats *psImageClippedStats (psImage *image, psImage *mask, psU8 maskValue, double fmin, double fmax); 14 14 15 15 // my temporary sort which is based on N.R.; seems to be faster than psLib sort???
Note:
See TracChangeset
for help on using the changeset viewer.
