From c9e71820ab9ee95d997e6dbf61338870c5a41ce3 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 26 Apr 2022 01:06:27 +0200 Subject: [PATCH] Fix python 3.8 breackage --- xarray_sentinel/sentinel1.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/xarray_sentinel/sentinel1.py b/xarray_sentinel/sentinel1.py index 98466ca..1995d98 100644 --- a/xarray_sentinel/sentinel1.py +++ b/xarray_sentinel/sentinel1.py @@ -304,7 +304,7 @@ def open_orbit_dataset( position = xr.Variable(data=data["position"], dims=("axis", "azimuth_time")) # type: ignore velocity = xr.Variable(data=data["velocity"], dims=("axis", "azimuth_time")) # type: ignore - attrs = attrs | {} + attrs = attrs.copy() if reference_system is not None: attrs.update({"reference_system": reference_system}) @@ -443,15 +443,18 @@ def open_pol_dataset( number_of_bursts = swath_timing["burstList"]["@count"] range_pixel_spacing = image_information["rangePixelSpacing"] - attrs = attrs | { - "radar_frequency": product_information["radarFrequency"] / 10**9, - "azimuth_pixel_spacing": image_information["azimuthPixelSpacing"], - "range_pixel_spacing": range_pixel_spacing, - "azimuth_time_interval": azimuth_time_interval, - "range_sampling_rate": range_sampling_rate, - "incidence_angle_mid_swath": image_information["incidenceAngleMidSwath"], - "ascending_node_time": image_information["ascendingNodeTime"], - } + attrs = attrs.copy() + attrs.update( + { + "radar_frequency": product_information["radarFrequency"] / 10**9, + "azimuth_pixel_spacing": image_information["azimuthPixelSpacing"], + "range_pixel_spacing": range_pixel_spacing, + "azimuth_time_interval": azimuth_time_interval, + "range_sampling_rate": range_sampling_rate, + "incidence_angle_mid_swath": image_information["incidenceAngleMidSwath"], + "ascending_node_time": image_information["ascendingNodeTime"], + } + ) encoding = {} swap_dims = {} chunks: T.Union[None, T.Dict[str, int]] = None