From 35435d1cb1144141b2c295af1cbc79c07d93a6d3 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 16 Mar 2022 16:16:57 -0400 Subject: [PATCH] use endswith instead of numerical indexing Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- icepyx/core/read.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepyx/core/read.py b/icepyx/core/read.py index 083f3864b..ac6fbc1ca 100644 --- a/icepyx/core/read.py +++ b/icepyx/core/read.py @@ -365,7 +365,7 @@ def _add_var_to_ds(is2ds, ds, grp_path, wanted_groups_tiered, wanted_dict): try: if ( hasattr(is2ds, "data_start_utc") - and is2ds["data_start_utc"].data[0].astype(str)[:-1] == "Z" + and is2ds["data_start_utc"].data[0].astype(str).endswith("Z") ): # manually remove 'Z' from datetime to allow conversion to np.datetime64 object (support for timezones is deprecated and causes a seg fault) is2ds["data_start_utc"] = np.datetime64(