From 4d37abc7d82018a6d5b1822d2cec56190ed0b791 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 11 Oct 2017 11:52:51 +0200 Subject: [PATCH] [update] flexibility for full_range teach PyLoT to cope with future (synthetic) events as well --- pylot/core/util/utils.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index 668d2984..17b8c426 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -318,13 +318,9 @@ def full_range(stream): :type stream: `~obspy.core.stream.Stream` :return: minimum start time and maximum end time ''' - min_start = UTCDateTime() - max_end = None - for trace in stream: - if trace.stats.starttime < min_start: - min_start = trace.stats.starttime - if max_end is None or trace.stats.endtime > max_end: - max_end = trace.stats.endtime + min_start = min([trace.stats.starttime for trace in stream]) + max_end = max([trace.stats.endtime for trace in stream]) + return min_start, max_end