From eb160446e5f2be9fb5debc1582c845b94553e58b Mon Sep 17 00:00:00 2001 From: Joleen Feltz Date: Wed, 26 May 2021 11:03:22 -0500 Subject: [PATCH 1/3] Use add_sectorid_global rather than apply so that the key in the yaml matches the code. --- satpy/writers/awips_tiled.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/writers/awips_tiled.py b/satpy/writers/awips_tiled.py index daf0fc84fa..29bed7a321 100644 --- a/satpy/writers/awips_tiled.py +++ b/satpy/writers/awips_tiled.py @@ -1060,7 +1060,7 @@ def apply_tile_info(self, new_ds, tile_info): return new_ds def _add_sector_id_global(self, new_ds, sector_id): - if not self._template_dict.get('apply_sector_id_global'): + if not self._template_dict.get('add_sector_id_global'): return if sector_id is None: From b89b721d6fb140c3d46aec5f200cbf86b03cca29 Mon Sep 17 00:00:00 2001 From: Joleen Feltz Date: Wed, 26 May 2021 11:42:42 -0500 Subject: [PATCH 2/3] Add test for sector id Change raw_value to value for default_clavrx physical_element since it is a variable rather than fix value. --- satpy/etc/writers/awips_tiled.yaml | 2 +- satpy/tests/writer_tests/test_awips_tiled.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/satpy/etc/writers/awips_tiled.yaml b/satpy/etc/writers/awips_tiled.yaml index 925b24ab00..43b7693f0e 100644 --- a/satpy/etc/writers/awips_tiled.yaml +++ b/satpy/etc/writers/awips_tiled.yaml @@ -118,7 +118,7 @@ templates: var_name: data attributes: physical_element: - raw_value: 'CLAVR-x {name}' + value: 'CLAVR-x {name}' clavrx_cloud_type: reader: clavrx name: cloud_type diff --git a/satpy/tests/writer_tests/test_awips_tiled.py b/satpy/tests/writer_tests/test_awips_tiled.py index aa31458d9b..83b8e04be9 100644 --- a/satpy/tests/writer_tests/test_awips_tiled.py +++ b/satpy/tests/writer_tests/test_awips_tiled.py @@ -187,6 +187,7 @@ def test_basic_numbered_tiles(self, tile_count, tile_size): ds = xr.open_dataset(fn, mask_and_scale=False) check_required_common_attributes(ds) assert ds.attrs['my_global'] == 'TEST' + assert ds.attrs['sector_id'] == 'TEST' stime = input_data_arr.attrs['start_time'] assert ds.attrs['start_date_time'] == stime.strftime('%Y-%m-%dT%H:%M:%S') From d8522ae4a849eb9d5356dae3be0f62a361ad163f Mon Sep 17 00:00:00 2001 From: Joleen Feltz Date: Wed, 26 May 2021 13:36:14 -0500 Subject: [PATCH 3/3] Typo fix: Change creating_entity to satellite_id. --- satpy/etc/writers/awips_tiled.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/etc/writers/awips_tiled.yaml b/satpy/etc/writers/awips_tiled.yaml index 43b7693f0e..9e41e1c454 100644 --- a/satpy/etc/writers/awips_tiled.yaml +++ b/satpy/etc/writers/awips_tiled.yaml @@ -66,7 +66,7 @@ templates: # value: "${ORGANIZATION}" awips_id: {} # value: "{awips_id}" # special variable created by awips_tiled.py - creating_entity: + satellite_id: value: "{platform_name!u}-{sensor!u}" sector_id: {} # special handler in awips_tiled.py coordinates: