From f40368a92280615cabc22c511aa08f4da14f6142 Mon Sep 17 00:00:00 2001 From: "Nina.Hakansson" Date: Thu, 7 Mar 2024 14:34:40 +0100 Subject: [PATCH] fixing tests --- level1c4pps/tests/test_seviri2pps.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/level1c4pps/tests/test_seviri2pps.py b/level1c4pps/tests/test_seviri2pps.py index 49f9d06..836fc1b 100644 --- a/level1c4pps/tests/test_seviri2pps.py +++ b/level1c4pps/tests/test_seviri2pps.py @@ -42,8 +42,8 @@ def get_fake_scene(): scene = Scene() start_time = dt.datetime(2020, 1, 1, 12) scene['VIS006'] = xr.DataArray( - [[1, 2], - [3, 4]], + [[1.0, 2.0], + [3.0, 4.0]], dims=('y', 'x'), attrs={'calibration': 'reflectance', 'sun_earth_distance_correction_applied': True, @@ -299,6 +299,8 @@ def test_add_ancillary_datasets(self): lats = np.array([[1.1, 2.1], [3.1, 4.1]]) sunz = np.array([[1.2, 2.2], [3.2, 4.2]]) satz = np.array([[1.3, 2.3], [3.3, 4.3]]) + suna = np.array([[5.2, 2.2], [5.2, 1.2]]) + sata = np.array([[3.3, 2.3], [3.3, 7.3]]) azidiff = np.array([[1.4, 2.4], [3.4, 4.4]]) ir_108 = xr.DataArray(data=np.array([[0.1, 0.2], [0.3, 0.4]]), @@ -312,6 +314,7 @@ def test_add_ancillary_datasets(self): scene = {'IR_108': ir_108} seviri2pps.add_ancillary_datasets(scene, lons=lons, lats=lats, sunz=sunz, satz=satz, + suna=suna, sata=sata, azidiff=azidiff) # Test lon/lat @@ -398,7 +401,7 @@ def test_get_encoding(self): enc_exp_time = {'units': 'days since 2004-01-01 00:00', 'calendar': 'standard', '_FillValue': None, - 'chunksizes': [1]} + 'chunksizes': (1,)} enc_exp_acq = {'units': 'milliseconds since 2009-07-01 12:15', 'calendar': 'standard', '_FillValue': -9999.0} @@ -426,7 +429,11 @@ def test_get_encoding(self): 'acq_time': enc_exp_acq } encoding = seviri2pps.get_encoding_seviri(scene) - self.assertDictEqual(encoding, encoding_exp) + for key in encoding_exp: + print(key) + print(encoding[key],encoding_exp[key]) + + self.assertDictEqual(encoding[key], encoding_exp[key]) def test_get_header_attrs(self): """Test get the header attributes."""