Skip to content

Commit

Permalink
get rindex_time via actually doing the math, this is faster than retr…
Browse files Browse the repository at this point in the history
…ieve the data sample time array
  • Loading branch information
yi-fan-wang committed Sep 15, 2023
1 parent 1186e5b commit b7534af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pycbc/types/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def gate(self, time, window=0.25, method='taper', copy=True,
rindex = int((time + window - self.start_time) / self.delta_t)
lindex = lindex if lindex >= 0 else 0
rindex = rindex if rindex <= len(self) else len(self)
rindex_time = data.sample_times[rindex]
rindex_time = float(self.start_time + rindex * self.delta_t)
offset = rindex_time - (time + window)
if offset == 0:
return gate_and_paint(data, lindex, rindex, invpsd, copy=False)
Expand Down

0 comments on commit b7534af

Please sign in to comment.