- Timestamp:
- 10/26/11 19:41:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r12069 r12278 207 207 const int64_t *trgoff, /*const*/ uint64_t scalerel) 208 208 { 209 210 209 /* 211 210 scalegain *= scaleabs; … … 272 271 } 273 272 274 /* 275 static void Apply(float *vec, const int16_t *val, const int16_t *start, uint32_t roi) 276 { 273 static void RemoveSpikes(float *vec, uint32_t roi) 274 { 275 if (roi<4) 276 return; 277 278 cout << "X" << endl; 279 277 280 for (size_t ch=0; ch<1440; ch++) 278 281 { 279 const size_t pos = ch*roi; 280 281 const int16_t spos = start[ch]; 282 if (spos<0) 283 { 284 memset(vec+pos, 0, roi); 285 continue; 286 } 287 288 for (size_t i=0; i<roi; i++) 289 vec[pos+i] = float(val[pos+i])/2; 290 } 291 }*/ 282 float *p = vec + ch*roi; 283 284 for (size_t i=1; i<roi-2; i++) 285 { 286 if (p[i]-p[i-1]>25 && p[i]-p[i+1]>25) 287 { 288 p[i] = (p[i-1]+p[i+1])/2; 289 } 290 291 if (p[i]-p[i-1]>22 && fabs(p[i]-p[i+1])<4 && p[i+1]-p[i+2]>22) 292 { 293 p[i] = (p[i-1]+p[i+2])/2; 294 p[i+1] = p[i]; 295 } 296 } 297 } 298 } 292 299 293 300 pair<vector<double>,vector<double> > GetSampleStats() const
Note:
See TracChangeset
for help on using the changeset viewer.