From aa52bdfdb671f29970ef9af9af45ab7d4dd55f2a Mon Sep 17 00:00:00 2001 From: Jan Jurgen Griesfeller Date: Tue, 15 Aug 2023 14:07:07 +0200 Subject: [PATCH] fix to make sure all station ids are strings --- pyaerocom/io/read_airnow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyaerocom/io/read_airnow.py b/pyaerocom/io/read_airnow.py index c4dd16617..029c08a73 100644 --- a/pyaerocom/io/read_airnow.py +++ b/pyaerocom/io/read_airnow.py @@ -402,7 +402,11 @@ def _filedata_to_statlist(self, arrs, vars_to_retrieve): mask = data[:, varcol] == var_in_file subset = data[mask] dtime_subset = dtime[mask] - statlist = np.unique(subset[:, statcol]) + # not all stations seems to provide the station id as string... + try: + statlist = np.unique(subset[:, statcol]) + except TypeError: + statlist = np.unique(str(subset[:, statcol])) for stat_id in tqdm(statlist, desc=var): if not stat_id in stat_ids: continue