From 2f8428cf3ccf3668dce01bedf5871119992f33d6 Mon Sep 17 00:00:00 2001 From: "E. Joshua Rigler" <erigler@usgs.gov> Date: Tue, 15 Nov 2022 15:05:14 -0700 Subject: [PATCH] Better way to create array of UTCDateTimes --- geomagio/algorithm/AverageAlgorithm.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/geomagio/algorithm/AverageAlgorithm.py b/geomagio/algorithm/AverageAlgorithm.py index 1787ad19..b065f51f 100644 --- a/geomagio/algorithm/AverageAlgorithm.py +++ b/geomagio/algorithm/AverageAlgorithm.py @@ -164,9 +164,7 @@ class AverageAlgorithm(Algorithm): # apply min_count_start and min_count_end # NOTE: the logic here is not very intuitive, but it works as intended - utc_datetimes = numpy.array( - [timeseries[0].stats.starttime + t for t in timeseries[0].times()] - ) + utc_datetimes = timeseries[0].times(type="utcdatetime") average_data[ (count_data < timeseries.count()) & (utc_datetimes > self.min_count_end) ] = numpy.nan -- GitLab