Skip to content

Commit

Permalink
Fix short/long names and make improvements raised in the review
Browse files Browse the repository at this point in the history
Signed-off-by: Adam.Dybbroe <[email protected]>
  • Loading branch information
Adam.Dybbroe committed Dec 20, 2024
1 parent 2b8aecb commit cd21dd2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion satpy/etc/readers/aws1_mwr_l1b_nc.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 10 additions & 10 deletions satpy/etc/readers/aws1_mwr_l1c_nc.yaml
Original file line number Diff line number Diff line change
@@ -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,]
Expand Down Expand Up @@ -328,35 +328,35 @@ 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
coordinates:
- 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
coordinates:
- 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
coordinates:
- 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
Expand Down
4 changes: 2 additions & 2 deletions satpy/etc/readers/eps_sterna_mwr_l1b_nc.yaml
Original file line number Diff line number Diff line change
@@ -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,]
Expand Down
2 changes: 1 addition & 1 deletion satpy/readers/mwr_l1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""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.
"""
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/reader_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions satpy/tests/reader_tests/test_aws1_mwr_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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):
Expand All @@ -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"),
Expand Down
7 changes: 2 additions & 5 deletions satpy/tests/reader_tests/test_aws1_mwr_l1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand Down
5 changes: 5 additions & 0 deletions satpy/tests/reader_tests/test_eps_sterna_mwr_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit cd21dd2

Please sign in to comment.