157
157
"CHK-BODY--L2P-NC4E_C_EUMT_20170410114434_GTT_DEV_"
158
158
"20170410113925_20170410113934_N__C_0070_0067.nc"
159
159
],
160
- "fdhsi_error" : [
161
- "W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FDD--"
162
- "CHK-BODY--L2P-NC4E_C_EUMT_20170410114434_GTT_DEV_"
163
- "20170410113925_20170410113934_N__C_0070_0067.nc"
164
- ],
165
160
"fdhsi_iqti" : [
166
161
"W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--"
167
162
"CHK-BODY--MON-NC4_C_EUMT_20240307233956_IQTI_DEV_"
183
178
],
184
179
"hrfi_q4" : ["W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-HRFI-Q4--"
185
180
"CHK-BODY--DIS-NC4E_C_EUMT_20230723025408_IDPFI_DEV"
186
- "_20230722120000_20230722120027_N_JLS_C_0289_0001.nc" ]
181
+ "_20230722120000_20230722120027_N_JLS_C_0289_0001.nc" ],
182
+ "hrfi_other_coverage" : ["W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-HRFI-xx--"
183
+ "CHK-BODY--DIS-NC4E_C_EUMT_20230723025408_IDPFI_DEV"
184
+ "_20230722120000_20230722120027_N_JLS_C_0289_0001.nc" ],
185
+ "fdhsi_other_coverage" : ["W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-xx--"
186
+ "CHK-BODY--DIS-NC4E_C_EUMT_20230723025408_IDPFI_DEV_"
187
+ "20230722120000_20230722120027_N_JLS_C_0289_0001.nc"
188
+ ],
187
189
}
188
190
189
191
@@ -607,29 +609,28 @@ def FakeFCIFileHandlerFDHSI_fixture():
607
609
608
610
609
611
@pytest .fixture
610
- def FakeFCIFileHandlerFDHSIError_fixture ():
611
- """Get a fixture for the fake FDHSI filehandler, including channel and file names."""
612
- with mocked_basefilehandler (FakeFCIFileHandlerFDHSI ):
612
+ def FakeFCIFileHandlerFDHSIIQTI_fixture ():
613
+ """Get a fixture for the fake FDHSI IQTI filehandler, including channel and file names."""
614
+ with mocked_basefilehandler (FakeFCIFileHandlerFDHSIIQTI ):
613
615
param_dict = {
614
616
"filetype" : "fci_l1c_fdhsi" ,
615
617
"channels" : CHANS_FDHSI ,
616
- "filenames" : TEST_FILENAMES ["fdhsi_error " ]
618
+ "filenames" : TEST_FILENAMES ["fdhsi_iqti " ]
617
619
}
618
620
yield param_dict
619
621
620
622
621
623
@pytest .fixture
622
- def FakeFCIFileHandlerFDHSIIQTI_fixture ():
623
- """Get a fixture for the fake FDHSI IQTI filehandler, including channel and file names."""
624
- with mocked_basefilehandler (FakeFCIFileHandlerFDHSIIQTI ):
624
+ def FakeFCIFileHandlerFDHSIOtherCoverage_fixture ():
625
+ """Get a fixture for the fake FDHSI filehandler for coverages not defined , including channel and file names."""
626
+ with mocked_basefilehandler (FakeFCIFileHandlerFDHSI ):
625
627
param_dict = {
626
628
"filetype" : "fci_l1c_fdhsi" ,
627
629
"channels" : CHANS_FDHSI ,
628
- "filenames" : TEST_FILENAMES ["fdhsi_iqti " ]
630
+ "filenames" : TEST_FILENAMES ["fdhsi_other_coverage " ]
629
631
}
630
632
yield param_dict
631
633
632
-
633
634
@pytest .fixture
634
635
def FakeFCIFileHandlerFDHSIQ4_fixture ():
635
636
"""Get a fixture for the fake FDHSI Q4 filehandler, including channel and file names."""
@@ -653,6 +654,16 @@ def FakeFCIFileHandlerHRFI_fixture():
653
654
}
654
655
yield param_dict
655
656
657
+ @pytest .fixture
658
+ def FakeFCIFileHandlerHRFIOtherCoverage_fixture ():
659
+ """Get a fixture for the fake HRFI filehandler for coverages not defined, including channel and file names."""
660
+ with mocked_basefilehandler (FakeFCIFileHandlerHRFI ):
661
+ param_dict = {
662
+ "filetype" : "fci_l1c_hrfi" ,
663
+ "channels" : CHANS_HRFI ,
664
+ "filenames" : TEST_FILENAMES ["hrfi_other_coverage" ]
665
+ }
666
+ yield param_dict
656
667
657
668
@pytest .fixture
658
669
def FakeFCIFileHandlerHRFIIQTI_fixture ():
@@ -709,7 +720,11 @@ class ModuleTestFCIL1cNcReader:
709
720
"hrfi_iqti" : {"channels" : CHANS_HRFI ,
710
721
"filenames" : TEST_FILENAMES ["hrfi_iqti" ]},
711
722
"fdhsi_q4" : {"channels" : CHANS_FDHSI ,
712
- "filenames" : TEST_FILENAMES ["fdhsi_q4" ]}}
723
+ "filenames" : TEST_FILENAMES ["fdhsi_q4" ]},
724
+ "fdhsi_other_coverage" : {"channels" : CHANS_FDHSI ,
725
+ "filenames" : TEST_FILENAMES ["fdhsi_other_coverage" ]},
726
+ "hrfi_other_coverage" : {"channels" : CHANS_HRFI ,
727
+ "filenames" : TEST_FILENAMES ["hrfi_other_coverage" ]}}
713
728
714
729
@staticmethod
715
730
def _get_type_ter_AF (channel ):
@@ -822,7 +837,9 @@ def test_file_pattern(self, reader_configs, filenames):
822
837
TEST_FILENAMES ["hrfi_q4" ][0 ].replace ("BODY" , "TRAIL" ),
823
838
TEST_FILENAMES ["fdhsi_q4" ][0 ].replace ("BODY" , "TRAIL" ),
824
839
TEST_FILENAMES ["fdhsi_iqti" ][0 ].replace ("BODY" , "TRAIL" ),
825
- TEST_FILENAMES ["hrfi_iqti" ][0 ].replace ("BODY" , "TRAIL" )])
840
+ TEST_FILENAMES ["hrfi_iqti" ][0 ].replace ("BODY" , "TRAIL" ),
841
+ TEST_FILENAMES ["hrfi_other_coverage" ][0 ].replace ("BODY" , "TRAIL" ),
842
+ TEST_FILENAMES ["fdhsi_other_coverage" ][0 ].replace ("BODY" , "TRAIL" )])
826
843
def test_file_pattern_for_TRAIL_file (self , reader_configs , filenames ):
827
844
"""Test file pattern matching for TRAIL files, which should not be picked up."""
828
845
from satpy .readers import load_reader
@@ -832,12 +849,16 @@ def test_file_pattern_for_TRAIL_file(self, reader_configs, filenames):
832
849
assert len (files ) == 0
833
850
834
851
@pytest .mark .parametrize ("calibration" , ["counts" , "radiance" , "brightness_temperature" , "reflectance" ])
835
- @pytest .mark .parametrize (("fh_param" , "res_type" ), [(lazy_fixture ("FakeFCIFileHandlerFDHSI_fixture" ), "hdfi" ),
836
- (lazy_fixture ("FakeFCIFileHandlerHRFI_fixture" ), "hrfi" ),
837
- (lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), "hrfi" ),
838
- (lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), "hdfi" ),
839
- (lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), "hrfi" ),
840
- (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), "hdfi" )])
852
+ @pytest .mark .parametrize (("fh_param" , "res_type" ), [
853
+ (lazy_fixture ("FakeFCIFileHandlerFDHSI_fixture" ), "hdfi" ),
854
+ (lazy_fixture ("FakeFCIFileHandlerHRFI_fixture" ), "hrfi" ),
855
+ (lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), "hrfi" ),
856
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), "hdfi" ),
857
+ (lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), "hrfi" ),
858
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), "hdfi" ),
859
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" ), "hdfi" ),
860
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ), "hrfi" ),
861
+ ])
841
862
def test_load_calibration (self , reader_configs , fh_param ,
842
863
caplog , calibration , res_type ):
843
864
"""Test loading with counts,radiance,reflectance and bt."""
@@ -915,7 +936,10 @@ def test_load_calibration_af(self, FakeFCIFileHandlerAF_fixture, reader_configs,
915
936
(lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" )),
916
937
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" )),
917
938
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" )),
918
- (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ))])
939
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" )),
940
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
941
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))
942
+ ])
919
943
def test_orbital_parameters_attr (self , reader_configs , fh_param ):
920
944
"""Test the orbital parameter attribute."""
921
945
reader = _get_reader_with_filehandlers (fh_param ["filenames" ], reader_configs )
@@ -945,7 +969,9 @@ def test_orbital_parameters_attr(self, reader_configs, fh_param):
945
969
(lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["hrfi" ]),
946
970
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["fdhsi" ]),
947
971
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["hrfi" ]),
948
- (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["fdhsi" ])
972
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["fdhsi" ]),
973
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["fdhsi" ]),
974
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ), EXPECTED_POS_INFO_FOR_FILETYPE ["hrfi" ])
949
975
])
950
976
def test_get_segment_position_info (self , reader_configs , fh_param , expected_pos_info ):
951
977
"""Test the segment position info method."""
@@ -969,13 +995,15 @@ def test_not_get_segment_info_called_af(self, FakeFCIFileHandlerAF_fixture, read
969
995
gspi .assert_not_called ()
970
996
971
997
@pytest .mark .parametrize ("calibration" , ["index_map" , "pixel_quality" ])
972
- @pytest .mark .parametrize (("fh_param" , "expected_res_n" ), [(lazy_fixture ("FakeFCIFileHandlerFDHSI_fixture" ), 16 ),
973
- (lazy_fixture ("FakeFCIFileHandlerHRFI_fixture" ), 4 ),
974
- (lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), 4 ),
975
- (lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), 16 ),
976
- (lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), 4 ),
977
- (
978
- lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), 16 )])
998
+ @pytest .mark .parametrize (("fh_param" , "expected_res_n" ), [
999
+ (lazy_fixture ("FakeFCIFileHandlerFDHSI_fixture" ), 16 ),
1000
+ (lazy_fixture ("FakeFCIFileHandlerHRFI_fixture" ), 4 ),
1001
+ (lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), 4 ),
1002
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), 16 ),
1003
+ (lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), 4 ),
1004
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), 16 ),
1005
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" ), 16 ),
1006
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ), 4 )])
979
1007
def test_load_map_and_pixel (self , reader_configs , fh_param , expected_res_n , calibration ):
980
1008
"""Test loading of index_map and pixel_quality."""
981
1009
reader = _get_reader_with_filehandlers (fh_param ["filenames" ], reader_configs )
@@ -1023,7 +1051,9 @@ def test_load_map_and_pixel_af(self, FakeFCIFileHandlerAF_fixture, reader_config
1023
1051
(lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" )),
1024
1052
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" )),
1025
1053
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" )),
1026
- (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ))])
1054
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" )),
1055
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
1056
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))])
1027
1057
def test_load_aux_data (self , reader_configs , fh_param ):
1028
1058
"""Test loading of auxiliary data."""
1029
1059
from satpy .readers .fci_l1c_nc import AUX_DATA
@@ -1048,6 +1078,8 @@ def test_load_aux_data(self, reader_configs, fh_param):
1048
1078
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" )),
1049
1079
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" )),
1050
1080
(lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" )),
1081
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
1082
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))
1051
1083
])
1052
1084
def test_platform_name (self , reader_configs , fh_param ):
1053
1085
"""Test that platform name is exposed.
@@ -1132,6 +1164,8 @@ def test_count_in_repeat_cycle_rc_period_min_AF(self, FakeFCIFileHandlerAF_fixtu
1132
1164
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" )),
1133
1165
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" )),
1134
1166
(lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" )),
1167
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
1168
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))
1135
1169
])
1136
1170
def test_compute_earth_sun_parameter (self , reader_configs , fh_param ):
1137
1171
"""Test the computation of the sun_earth_parameter."""
@@ -1145,19 +1179,24 @@ def test_compute_earth_sun_parameter_AF(self, FakeFCIFileHandlerAF_fixture, read
1145
1179
fh_param = FakeFCIFileHandlerAF_fixture
1146
1180
self ._compare_sun_earth_distance (f"{ fh_param ['filetype' ]} _{ channel } _{ resolution } " , fh_param , reader_configs )
1147
1181
1148
- @pytest .mark .parametrize (("fh_param" ), [(lazy_fixture ("FakeFCIFileHandlerFDHSIError_fixture" ))])
1149
- def test_rc_period_min_error (self , reader_configs , fh_param ):
1182
+ @pytest .mark .parametrize (("fh_param" ), [ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
1183
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))])
1184
+ def test_rc_period_min_log_message_other_coverage (self , reader_configs , fh_param , caplog ):
1150
1185
"""Test the rc_period_min error."""
1151
- with pytest . raises ( NotImplementedError ):
1186
+ with caplog . at_level ( logging . DEBUG ):
1152
1187
_get_reader_with_filehandlers (fh_param ["filenames" ], reader_configs )
1188
+ assert any ('Coverage "xx" not recognised. Using observation times for nominal times.'
1189
+ in message for message in caplog .messages )
1153
1190
1154
1191
@pytest .mark .parametrize (("fh_param" , "expected_area" ), [
1155
1192
(lazy_fixture ("FakeFCIFileHandlerFDHSI_fixture" ), ["mtg_fci_fdss_1km" , "mtg_fci_fdss_2km" ]),
1156
1193
(lazy_fixture ("FakeFCIFileHandlerHRFI_fixture" ), ["mtg_fci_fdss_500m" , "mtg_fci_fdss_1km" ]),
1157
1194
(lazy_fixture ("FakeFCIFileHandlerHRFIQ4_fixture" ), ["mtg_fci_fdss_500m" , "mtg_fci_fdss_1km" ]),
1158
1195
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" ), ["mtg_fci_fdss_1km" , "mtg_fci_fdss_2km" ]),
1159
1196
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" ), ["mtg_fci_fdss_500m" , "mtg_fci_fdss_1km" ]),
1160
- (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), ["mtg_fci_fdss_1km" , "mtg_fci_fdss_2km" ])
1197
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" ), ["mtg_fci_fdss_1km" , "mtg_fci_fdss_2km" ]),
1198
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" ), ["mtg_fci_fdss_1km" , "mtg_fci_fdss_2km" ]),
1199
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ), ["mtg_fci_fdss_500m" , "mtg_fci_fdss_1km" ])
1161
1200
])
1162
1201
def test_area_definition_computation (self , reader_configs , fh_param , expected_area ):
1163
1202
"""Test that the geolocation computation is correct."""
@@ -1189,6 +1228,8 @@ def test_area_definition_computation(self, reader_configs, fh_param, expected_ar
1189
1228
(lazy_fixture ("FakeFCIFileHandlerFDHSIQ4_fixture" )),
1190
1229
(lazy_fixture ("FakeFCIFileHandlerHRFIIQTI_fixture" )),
1191
1230
(lazy_fixture ("FakeFCIFileHandlerFDHSIIQTI_fixture" )),
1231
+ (lazy_fixture ("FakeFCIFileHandlerFDHSIOtherCoverage_fixture" )),
1232
+ (lazy_fixture ("FakeFCIFileHandlerHRFIOtherCoverage_fixture" ))
1192
1233
])
1193
1234
def test_excs (self , reader_configs , fh_param ):
1194
1235
"""Test that exceptions are raised where expected."""
0 commit comments