satpy.tests.reader_tests.test_fci_l1c_nc module

Tests for the ‘fci_l1c_nc’ reader.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerBase(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False, extra_file_content=None)[source]

Bases: FakeNetCDF4FileHandler

Class for faking the NetCDF4 Filehandler.

Get fake file content from ‘get_test_content’.

cached_file_content: Dict[str, DataArray] = {}
chan_patterns: Dict[str, Dict[str, List[int] | str]] = {}
get_test_content(filename, filename_info, filetype_info)[source]

Get the content of the test data.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerFDHSI(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False, extra_file_content=None)[source]

Bases: FakeFCIFileHandlerBase

Mock FDHSI data.

Get fake file content from ‘get_test_content’.

chan_patterns: Dict[str, Dict[str, List[int] | str]] = {'ir_{:>02d}': {'channels': [38, 87, 97, 105, 123, 133], 'grid_type': '2km'}, 'nir_{:>02d}': {'channels': [13, 16, 22], 'grid_type': '1km'}, 'vis_{:>02d}': {'channels': [4, 5, 6, 8, 9], 'grid_type': '1km'}, 'wv_{:>02d}': {'channels': [63, 73], 'grid_type': '2km'}}
satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerFDHSI_fixture()[source]

Get a fixture for the fake FDHSI filehandler, including channel and file names.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerHRFI(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False, extra_file_content=None)[source]

Bases: FakeFCIFileHandlerBase

Mock HRFI data.

Get fake file content from ‘get_test_content’.

chan_patterns: Dict[str, Dict[str, List[int] | str]] = {'ir_{:>02d}_hr': {'channels': [38, 105], 'grid_type': '1km'}, 'nir_{:>02d}_hr': {'channels': [22], 'grid_type': '500m'}, 'vis_{:>02d}_hr': {'channels': [6], 'grid_type': '500m'}}
satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerHRFI_fixture()[source]

Get a fixture for the fake HRFI filehandler, including channel and file names.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerWithBadData(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False, extra_file_content=None)[source]

Bases: FakeFCIFileHandlerFDHSI

Mock bad data.

Get fake file content from ‘get_test_content’.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerWithBadIDPFData(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False, extra_file_content=None)[source]

Bases: FakeFCIFileHandlerFDHSI

Mock bad data for IDPF TO-DO’s.

Get fake file content from ‘get_test_content’.

class satpy.tests.reader_tests.test_fci_l1c_nc.FakeH5Variable(data, dims=(), attrs=None)[source]

Bases: object

Class for faking h5netcdf.Variable class.

Initialize the class.

property ndim

Get the number of dimensions.

property shape

Get the shape.

class satpy.tests.reader_tests.test_fci_l1c_nc.TestFCIL1cNCReader[source]

Bases: object

Test FCI L1c NetCDF reader with nominal data.

expected_pos_info_for_filetype = {'fdhsi': {'1km': {'end_position_row': 200, 'grid_width': 11136, 'segment_height': 200, 'start_position_row': 1}, '2km': {'end_position_row': 100, 'grid_width': 5568, 'segment_height': 100, 'start_position_row': 1}}, 'hrfi': {'1km': {'end_position_row': 200, 'grid_width': 11136, 'segment_height': 200, 'start_position_row': 1}, '500m': {'end_position_row': 400, 'grid_width': 22272, 'segment_height': 400, 'start_position_row': 1}}}
fh_param_for_filetype = {'fdhsi': {'channels': {'solar': ['vis_04', 'vis_05', 'vis_06', 'vis_08', 'vis_09', 'nir_13', 'nir_16', 'nir_22'], 'solar_grid_type': ['1km', '1km', '1km', '1km', '1km', '1km', '1km', '1km'], 'terran': ['ir_38', 'wv_63', 'wv_73', 'ir_87', 'ir_97', 'ir_105', 'ir_123', 'ir_133'], 'terran_grid_type': ['2km', '2km', '2km', '2km', '2km', '2km', '2km', '2km']}, 'filenames': ['W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--L2P-NC4E_C_EUMT_20170410114434_GTT_DEV_20170410113925_20170410113934_N__C_0070_0067.nc']}, 'hrfi': {'channels': {'solar': ['vis_06', 'nir_22'], 'solar_grid_type': ['500m', '500m'], 'terran': ['ir_38', 'ir_105'], 'terran_grid_type': ['1km', '1km']}, 'filenames': ['W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-HRFI-FD--CHK-BODY--L2P-NC4E_C_EUMT_20170410114434_GTT_DEV_20170410113925_20170410113934_N__C_0070_0067.nc']}}
test_area_definition_computation(reader_configs, fh_param, expected_area)[source]

Test that the geolocation computation is correct.

test_excs(reader_configs, fh_param)[source]

Test that exceptions are raised where expected.

test_file_pattern(reader_configs, filenames)[source]

Test file pattern matching.

test_file_pattern_for_TRAIL_file(reader_configs, filenames)[source]

Test file pattern matching for TRAIL files, which should not be picked up.

test_get_segment_position_info(reader_configs, fh_param, expected_pos_info)[source]

Test the segment position info method.

test_load_aux_data(reader_configs, fh_param)[source]

Test loading of auxiliary data.

test_load_bt(reader_configs, caplog, fh_param, expected_res_n)[source]

Test loading with bt.

test_load_composite()[source]

Test that composites are loadable.

test_load_counts(reader_configs, fh_param, expected_res_n)[source]

Test loading with counts.

test_load_index_map(reader_configs, fh_param, expected_res_n)[source]

Test loading of index_map.

test_load_quality_only(reader_configs, fh_param, expected_res_n)[source]

Test that loading quality only works.

test_load_radiance(reader_configs, fh_param, expected_res_n)[source]

Test loading with radiance.

test_load_reflectance(reader_configs, fh_param, expected_res_n)[source]

Test loading with reflectance.

test_orbital_parameters_attr(reader_configs, fh_param)[source]

Test the orbital parameter attribute.

test_platform_name(reader_configs, fh_param)[source]

Test that platform name is exposed.

Test that the FCI reader exposes the platform name. Corresponds to GH issue 1014.

class satpy.tests.reader_tests.test_fci_l1c_nc.TestFCIL1cNCReaderBadData[source]

Bases: object

Test the FCI L1c NetCDF Reader for bad data input.

test_handling_bad_data_ir(reader_configs, caplog)[source]

Test handling of bad IR data.

test_handling_bad_data_vis(reader_configs, caplog)[source]

Test handling of bad VIS data.

class satpy.tests.reader_tests.test_fci_l1c_nc.TestFCIL1cNCReaderBadDataFromIDPF[source]

Bases: object

Test the FCI L1c NetCDF Reader for bad data input, specifically the IDPF issues.

test_bad_xy_coords(reader_configs)[source]

Test that the geolocation computation is correct.

test_handling_bad_earthsun_distance(reader_configs)[source]

Test handling of bad earth-sun distance data.

satpy.tests.reader_tests.test_fci_l1c_nc.clear_cache(reader)[source]

Clear the cache for file handlres in reader.

satpy.tests.reader_tests.test_fci_l1c_nc.mocked_basefilehandler(filehandler)[source]

Mock patch the base class of the FCIL1cNCFileHandler with the content of our fake files (filehandler).

satpy.tests.reader_tests.test_fci_l1c_nc.reader_configs()[source]

Return reader configs for FCI.