From 957b798974851b69a30c720235fdb07c74f5ccf6 Mon Sep 17 00:00:00 2001 From: grouazel Date: Thu, 15 Feb 2024 16:31:39 +0100 Subject: [PATCH] fix bug with pol attr --- l2awinddirection/mainl2awinddirection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l2awinddirection/mainl2awinddirection.py b/l2awinddirection/mainl2awinddirection.py index 551b953..bf39cc9 100644 --- a/l2awinddirection/mainl2awinddirection.py +++ b/l2awinddirection/mainl2awinddirection.py @@ -247,7 +247,11 @@ def main(): res = generate_wind_product(tiles, model_m64rn4) res.attrs["winddirection_L2A_processor"] = "l2awinddirection" res.attrs["winddirection_L2A_processor_version"] = l2awinddirection.__version__ - res.attrs["used_channel"] = res.coords["pol"].values + if 'pol' in res.coords: + res.attrs["used_channel"] = res.coords["pol"].values + else: + res.attrs['used_channel'] = res['selected_pol'].values + # res.attrs["used_channel"] = res.attrs["winddirection_L2A_processor_mode"] = args.mode if 'pol' in res.coords: res = res.drop('pol')