From 58ba80f98a9768813ca679793b1f5f1795cbb8ee Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Wed, 25 Aug 2021 15:35:17 -0500 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 60ab8d94..38d14246 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -1494,18 +1494,19 @@ def spatial_filter(icing_dict): return grd_bins -# dt_str_0: start datetime string in format YYYY-MM-DD_HH:MM -# dt_str_1: end datetime string in format YYYY-MM-DD_HH:MM +# dt_str_0: start datetime string in format YYYY-MM-DD_HH:MM (default) +# dt_str_1: end datetime string in format YYYY-MM-DD_HH:MM (default) +# format_code: Python Datetime format code, default: '%Y-%m-%d_%H:%M' # return a flatten list of icing reports -def time_filter(icing_dct, dt_str_0=None, dt_str_1=None): +def time_filter(icing_dct, dt_str_0=None, dt_str_1=None, format_code='%Y-%m-%d_%H:%M'): ts_0 = 0 if dt_str_0 is not None: - dto_0 = datetime.datetime.strptime(dt_str_0, '%Y-%m-%d_%H:%M').replace(tzinfo=timezone.utc) + dto_0 = datetime.datetime.strptime(dt_str_0, format_code).replace(tzinfo=timezone.utc) ts_0 = dto_0.timestamp() ts_1 = np.finfo(np.float64).max if dt_str_1 is not None: - dto_1 = datetime.datetime.strptime(dt_str_1, '%Y-%m-%d_%H:%M').replace(tzinfo=timezone.utc) + dto_1 = datetime.datetime.strptime(dt_str_1, format_code).replace(tzinfo=timezone.utc) ts_1 = dto_1.timestamp() keep_reports = [] -- GitLab