Skip to content

Commit

Permalink
Fix burst search when no slice is specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritemio committed Aug 26, 2015
1 parent e84b973 commit e643c6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fretbursts/burstsearch/burstsearchlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def bsearch_py(times, L, m, T, slice_=None,
photons.
Arguments:
time (array, int64): array of timestamps on which to perform the search
times (array, int64): array of timestamps on which to perform the search
L (int): minimum number of photons in a bursts. Bursts with size
(or counts) < L are discarded.
m (int): number of consecutive photons used to compute the rate.
Expand All @@ -86,6 +86,8 @@ def bsearch_py(times, L, m, T, slice_=None,
"""
if verbose:
pprint('Python search (v): %s\n' % label)

i_time0 = 0
if slice_ is not None:
times = times[slice_[0]:slice_[1]]
i_time0 = slice_[0]
Expand Down
4 changes: 4 additions & 0 deletions fretbursts/burstsearch/burstsearchlib_c.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def bsearch_c(np.int64_t[:] times, np.int16_t L, np.int16_t m,
(or counts) < L are discarded.
m (int): number of consecutive photons used to compute the rate.
T (float): max time separation of `m` photons to be inside a burst
slice_ (tuple): 2-element tuple used to slice times
label (string): a label printed when the function is called
verbose (bool): if False, the function does not print anything.
Expand All @@ -52,6 +53,9 @@ def bsearch_c(np.int64_t[:] times, np.int16_t L, np.int16_t m,
if slice_ is not None:
islice1 = slice_[0]
islice2 = slice_[1]
else:
islice1 = 0
islice2 = times.size

bursts = []
in_burst = 0
Expand Down

0 comments on commit e643c6d

Please sign in to comment.