Changeset 12951 for fact/tools/pyscripts


Ignore:
Timestamp:
02/28/12 17:43:28 (13 years ago)
Author:
neise
Message:
debugged interpolation of zero-x-ing time in class ZeroXing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/pyfact/extractor.py

    r12949 r12951  
    8282                        continue
    8383                if ( pix_data[i] * pix_data[i+1] <= 0 ):
    84                     time = (pix_data[i+1]*i-pix_data[i]*(i+1))
     84                    # interpolate time of zero crossing with
     85                    # linear polynomial: y = ax + b
     86                    a = (pix_data[i+1] - pix_data[i]) / ((i+1) - i)
     87                    time = -1.0/a * pix_data[i] + i
    8588                    hits.append(time)
    8689            all_hits.append(hits)
Note: See TracChangeset for help on using the changeset viewer.