tomtag.count_twofolds
tomtag.count_twofolds(tagsA, tagsB, sizeA, sizeB, tcc)
Count the number of entries of two arrays that fall within the coincidence window of eachother.
- Parameters
- tagsA: ndarray(dtype=int)
- timetags of the first channel.
- tagsB: ndarray(dtype=int)
- timetags of the second channel.
- sizeA: int
- number of timetags in the first channel.
- sizeB: int
- number of timetags in the second channel.
- tcc: int
- size of coincidence window, as multiple of tag precision.
- tagsA: ndarray(dtype=int)
- Returns
- count (int): The number of tags that fall within the coincidence window of eachother between tagsA and tagsB.
Examples
>>> import tomtag as tt
>>> import numpy as np
>>> tagsA = np.array([12,679,1289,1487])
>>> tagsB = np.array([20,409,1279,1887])
>>> tcc = 15
>>>
>>> counts = tt.count_twofolds(tagsA, tagsB, len(tagsA), len(tagsB), tcc)
>>> assert counts==2