From cd21dd258f2f8545332cdd69f5672eee179c0acd Mon Sep 17 00:00:00 2001 From: "Adam.Dybbroe" Date: Fri, 20 Dec 2024 13:26:50 +0100 Subject: [PATCH] Fix short/long names and make improvements raised in the review Signed-off-by: Adam.Dybbroe --- satpy/etc/readers/aws1_mwr_l1b_nc.yaml | 2 +- satpy/etc/readers/aws1_mwr_l1c_nc.yaml | 20 +++++++++---------- satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml | 4 ++-- satpy/readers/mwr_l1c.py | 2 +- satpy/tests/reader_tests/conftest.py | 2 +- satpy/tests/reader_tests/test_aws1_mwr_l1b.py | 7 +++---- satpy/tests/reader_tests/test_aws1_mwr_l1c.py | 7 ++----- .../reader_tests/test_eps_sterna_mwr_l1b.py | 5 +++++ 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/satpy/etc/readers/aws1_mwr_l1b_nc.yaml b/satpy/etc/readers/aws1_mwr_l1b_nc.yaml index bbc4a567e7..4b3cccc648 100644 --- a/satpy/etc/readers/aws1_mwr_l1b_nc.yaml +++ b/satpy/etc/readers/aws1_mwr_l1b_nc.yaml @@ -1,6 +1,6 @@ reader: name: aws1_mwr_l1b_nc - short_name: AWS1 MWR L1B RAD NetCDF4 + short_name: AWS1 MWR L1B long_name: AWS1 MWR L1B Radiance (NetCDF4) description: Reader for the ESA AWS (Arctic Weather Satellite) Microwave Radiometer (MWR) level-1b files in netCDF4. reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader diff --git a/satpy/etc/readers/aws1_mwr_l1c_nc.yaml b/satpy/etc/readers/aws1_mwr_l1c_nc.yaml index e62b88d54d..e27cc99a2d 100644 --- a/satpy/etc/readers/aws1_mwr_l1c_nc.yaml +++ b/satpy/etc/readers/aws1_mwr_l1c_nc.yaml @@ -1,7 +1,7 @@ reader: name: aws1_mwr_l1c_nc - short_name: AWS L1C RAD NetCDF4 - long_name: AWS L1C Radiance (NetCDF4) + short_name: AWS1 MWR L1C + long_name: AWS1 MWR L1C Radiance (NetCDF4) description: Reader for the ESA AWS (Arctic Weather Satellite) MWR level-1c files in netCDF4. reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader sensors: [mwr,] @@ -328,8 +328,8 @@ datasets: # --- Navigation data --- - solar_azimuth: - name: solar_azimuth + solar_azimuth_angle: + name: solar_azimuth_angle file_type: aws_l1c_nc file_key: data/navigation/aws_solar_azimuth_angle standard_name: solar_azimuth_angle @@ -337,8 +337,8 @@ datasets: - longitude - latitude - solar_zenith: - name: solar_zenith + solar_zenith_angle: + name: solar_zenith_angle file_type: aws_l1c_nc file_key: data/navigation/aws_solar_zenith_angle standard_name: solar_zenith_angle @@ -346,8 +346,8 @@ datasets: - longitude - latitude - satellite_azimuth: - name: satellite_azimuth + satellite_azimuth_angle: + name: satellite_azimuth_angle file_type: aws_l1c_nc file_key: data/navigation/aws_satellite_azimuth_angle standard_name: satellite_azimuth_angle @@ -355,8 +355,8 @@ datasets: - longitude - latitude - satellite_zenith: - name: satellite_zenith + satellite_zenith_angle: + name: satellite_zenith_angle file_type: aws_l1c_nc file_key: data/navigation/aws_satellite_zenith_angle standard_name: satellite_zenith_angle diff --git a/satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml b/satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml index efc7dc8bc9..fe5bea93b2 100644 --- a/satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml +++ b/satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml @@ -1,7 +1,7 @@ reader: name: eps_sterna_mwr_l1b_nc - short_name: AWS L1B RAD NetCDF4 - long_name: AWS L1B Radiance (NetCDF4) + short_name: EPS-Sterna MWR L1B + long_name: EPS-Sterna MWR L1B Radiance (NetCDF4) description: Reader for the EUMETSAT EPS-Sterna radiometer level-1b files in netCDF4. reader: !!python/name:satpy.readers.yaml_reader.FileYAMLReader sensors: [mwr,] diff --git a/satpy/readers/mwr_l1c.py b/satpy/readers/mwr_l1c.py index d14ab6783a..0182b1d77c 100644 --- a/satpy/readers/mwr_l1c.py +++ b/satpy/readers/mwr_l1c.py @@ -14,7 +14,7 @@ # along with this program. If not, see . """Reader for the Arctic Weather Satellite (AWS) MWR level-1c data. -MWR = Microwaver Radiometer, onboard AWS and EPS-Sterna +MWR = Microwave Radiometer, onboard AWS and EPS-Sterna Sample data provided by ESA September 27, 2024. """ diff --git a/satpy/tests/reader_tests/conftest.py b/satpy/tests/reader_tests/conftest.py index cfee6d4523..92e9ef5445 100644 --- a/satpy/tests/reader_tests/conftest.py +++ b/satpy/tests/reader_tests/conftest.py @@ -147,7 +147,7 @@ def eps_sterna_mwr_file(tmp_path_factory, fake_mwr_data_array): tmp_dir = tmp_path_factory.mktemp("eps_sterna_mwr_l1b_tests") start_time = dt.datetime.fromisoformat(ds.attrs["sensing_start_time_utc"]) end_time = dt.datetime.fromisoformat(ds.attrs["sensing_end_time_utc"]) - platform_name = "AWS1" + platform_name = "ST01" processing_time = random_date(dt.datetime(2024, 9, 1, 13), dt.datetime(2030, 6, 1)) filename = tmp_dir / compose(file_pattern, dict(country="XX", organisation="EUMETSAT", diff --git a/satpy/tests/reader_tests/test_aws1_mwr_l1b.py b/satpy/tests/reader_tests/test_aws1_mwr_l1b.py index cfecfd4a66..59c429cca5 100644 --- a/satpy/tests/reader_tests/test_aws1_mwr_l1b.py +++ b/satpy/tests/reader_tests/test_aws1_mwr_l1b.py @@ -8,8 +8,7 @@ from satpy.tests.reader_tests.conftest import make_fake_angles, make_fake_mwr_lonlats -platform_name = "AWS1" -file_pattern = "W_XX-OHB-Stockholm,SAT,{platform_name}-MWR-1B-RAD_C_OHB_{processing_time:%Y%m%d%H%M%S}_G_D_{start_time:%Y%m%d%H%M%S}_{end_time:%Y%m%d%H%M%S}_T_B____.nc" # noqa +PLATFORM_NAME = "AWS1" geo_dims = ["n_scans", "n_fovs", "n_geo_groups"] @@ -37,7 +36,7 @@ def test_orbit_number_start_end(aws_mwr_handler): def test_metadata(aws_mwr_handler): """Test that the metadata is read correctly.""" assert aws_mwr_handler.sensor == "mwr" - assert aws_mwr_handler.platform_name == platform_name + assert aws_mwr_handler.platform_name == PLATFORM_NAME def test_get_channel_data(aws_mwr_handler, fake_mwr_data_array): @@ -61,7 +60,7 @@ def test_get_channel_data(aws_mwr_handler, fake_mwr_data_array): assert res.dims == ("y", "x") assert "n_channels" not in res.coords assert res.attrs["sensor"] == "mwr" - assert res.attrs["platform_name"] == "AWS1" + assert res.attrs["platform_name"] == PLATFORM_NAME @pytest.mark.parametrize(("id_name", "file_key", "fake_array"), diff --git a/satpy/tests/reader_tests/test_aws1_mwr_l1c.py b/satpy/tests/reader_tests/test_aws1_mwr_l1c.py index 9fe034a76d..7ebca463fa 100644 --- a/satpy/tests/reader_tests/test_aws1_mwr_l1c.py +++ b/satpy/tests/reader_tests/test_aws1_mwr_l1c.py @@ -24,10 +24,7 @@ from satpy.tests.reader_tests.conftest import make_fake_angles, make_fake_mwr_l1c_lonlats -platform_name = "AWS1" -# W_XX-OHB-Stockholm,SAT,AWS1-MWR-1C-RAD_C_OHB__20241126183628_G_D_20240913222540_20240914000332_T_B____.nc -file_pattern = "W_XX-OHB-Stockholm,SAT,{platform_name}-MWR-1C-RAD_C_OHB__{processing_time:%Y%m%d%H%M%S}_G_D_{start_time:%Y%m%d%H%M%S}_{end_time:%Y%m%d%H%M%S}_T_B____.nc" # noqa - +PLATFORM_NAME = "AWS1" geo_dims = ["n_scans", "n_fovs"] geo_size = 10 * 145 @@ -57,7 +54,7 @@ def test_get_channel_data(aws_mwr_l1c_handler, fake_mwr_data_array): assert res.dims == ("y", "x") assert "n_channels" not in res.coords assert res.attrs["sensor"] == "mwr" - assert res.attrs["platform_name"] == "AWS1" + assert res.attrs["platform_name"] == PLATFORM_NAME @pytest.mark.parametrize(("id_name", "file_key", "fake_array"), diff --git a/satpy/tests/reader_tests/test_eps_sterna_mwr_l1b.py b/satpy/tests/reader_tests/test_eps_sterna_mwr_l1b.py index 0620bc8437..bd9be5b694 100644 --- a/satpy/tests/reader_tests/test_eps_sterna_mwr_l1b.py +++ b/satpy/tests/reader_tests/test_eps_sterna_mwr_l1b.py @@ -61,3 +61,8 @@ def test_try_get_data_not_in_file(eps_sterna_mwr_handler): match_str = "Dataset aws_toa_brightness_temperature not available or not supported yet!" with pytest.raises(NotImplementedError, match=match_str): _ = eps_sterna_mwr_handler.get_dataset(did, dataset_info) + +def test_metadata(eps_sterna_mwr_handler): + """Test that the metadata is read correctly.""" + assert eps_sterna_mwr_handler.sensor == "mwr" + assert eps_sterna_mwr_handler.platform_name == "ST01"