Changeset 16843 for trunk/Mars/mcore
- Timestamp:
- 06/14/13 11:27:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mcore/DrsCalib.h
r16603 r16843 807 807 return -1; 808 808 809 const int beg = roi>10 ? 10 : 0; 809 // Skip first 10 samples 810 const uint beg = roi>10 ? 10 : 0; 811 const uint end = roi-beg>5 ? roi-5 : roi; 812 const uint len = end-beg; 810 813 811 814 double max = 0; 812 for (int i=0; i<1440; i++) 815 double patch = 0; 816 for (uint i=0; i<1440; i++) 813 817 { 814 818 const float *vec = data+i*roi; 815 819 816 intpos = beg;820 uint pos = beg; 817 821 double sum = vec[beg]; 818 822 double sum2 = vec[beg]*vec[beg]; 819 for (int j=beg+1; j<roi; j++) 823 824 for (uint j=beg+1; j<end; j++) 820 825 { 821 826 sum += vec[j]; … … 825 830 pos = j; 826 831 } 827 sum /= roi-beg; 828 sum2 /= roi-beg; 829 830 if (vec[pos]>0) 831 max = vec[pos]; 832 sum /= len; 833 sum2 /= len; 834 835 if (i%9!=8 && vec[pos]>0) 836 patch += vec[pos]; 837 838 if (i%9==8) 839 { 840 patch /= 8; 841 if (patch > max) 842 max = patch; 843 patch = 0; 844 } 845 846 //if (i%9!=8 && vec[pos]>max) 847 // max = vec[pos]; 832 848 833 849 *(ptr+0*1440+i) = sum;
Note:
See TracChangeset
for help on using the changeset viewer.