Skip to content

Commit

Permalink
Merge pull request #128 from chime-experiment/kef/find_jump
Browse files Browse the repository at this point in the history
fix(find_jump): check for empty query results
  • Loading branch information
anjakefala authored Dec 14, 2019
2 parents d9956d2 + 2d09055 commit 37920d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dias/analyzers/find_jump_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from dias import chime_analyzer
from dias.utils.string_converter import str2timedelta, datetime2str
from dias import __version__ as dias_version_tag
from dias.exception import DiasDataError

__version__ = "0.1.0"

Expand Down Expand Up @@ -687,6 +688,9 @@ def run(self):
query = "SELECT AVG(ntime), AVG(time_step) FROM files"
avg_ntime, avg_time_step = list(cursor.execute(query))[0]

if (avg_ntime is None) or (avg_time_step is None):
raise DiasDataError("Jump time step data is not available")

offset_start = datetime.timedelta(seconds=self.nedge * avg_time_step)
offset_nfile = int(np.ceil(2 * self.nedge / float(avg_ntime)))

Expand Down

0 comments on commit 37920d0

Please sign in to comment.