Skip to content

Commit

Permalink
Fix case when data is missing at beginning of vt span
Browse files Browse the repository at this point in the history
  • Loading branch information
dethodav committed Oct 23, 2023
1 parent f658c15 commit 82cacab
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gwsumm/plot/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ def livetime_(t):
return (4/3. * pi * ts * range ** 3).to('Mpc^3 kyr')

def combined_time_volume(self, allsegments, allranges):
empty = [i for i, r in enumerate(allranges) if not len(r.value)]
for i in empty[-1:]:
allsegments.pop(i)
allranges.pop(i)
min_x0 = min([r.x0.value for r in allranges])
for i, r in enumerate(allranges):
if r.x0.value > min_x0:
missing = int( (r.x0.value - min_x0) / r.dx.value)
allranges[i] = r.pad((missing, 0))
try:
combined_range = TimeSeries(numpy.zeros(allranges[0].size),
xindex=allranges[0].times, unit='Mpc')
Expand Down

0 comments on commit 82cacab

Please sign in to comment.