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.FakeFCIFileHandlerAF(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 AF data.

Get fake file content from ‘get_test_content’.

chan_patterns: Dict[str, Dict[str, List[int] | str]] = {}
satpy.tests.reader_tests.test_fci_l1c_nc.FakeFCIFileHandlerAF_fixture(channel, resolution)[source]

Get a fixture for the fake AF filehandler, it contains only one channel and one resolution.

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’.

_get_test_content_all_channels()[source]
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’.

_get_test_content_all_channels()[source]
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’.

_get_test_content_all_channels()[source]
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.

_set_meta()[source]
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.

_get_assert_attrs(res, ch, attrs_dict)[source]

Test the differents attributes values.

_get_assert_load(res, ch, grid_type, dict_arg)[source]

Test the value for differents channels.

_get_res_AF(channel, fh_param, calibration, reader_configs)[source]

Load the reader for AF data.

_get_type_ter_AF(channel)[source]

Get the type_ter.

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_calibration(reader_configs, fh_param, caplog, calibration, res_type)[source]

Test loading with counts,radiance,reflectance and bt.

test_load_calibration_af(FakeFCIFileHandlerAF_fixture, reader_configs, channel, calibration, caplog)[source]

Test loading with counts,radiance,reflectance and bt for AF files.

test_load_composite()[source]

Test that composites are loadable.

test_load_map_and_pixel(reader_configs, fh_param, expected_res_n, calibration)[source]

Test loading of index_map and pixel_quality.

test_load_map_and_pixel_af(FakeFCIFileHandlerAF_fixture, reader_configs, channel, calibration)[source]

Test loading with of index_map and pixel_quality for AF files.

test_not_get_segment_info_called_af(FakeFCIFileHandlerAF_fixture, reader_configs, channel, resolution)[source]

Test that checks that the get_segment_position_info has not been called for AF data.

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._get_global_attributes()[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_reader_with_filehandlers(filenames, reader_configs)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_calib_data_for_channel(data, ch_str)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_calib_for_channel_ir(data, meas_path)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_calib_for_channel_vis(data, meas)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_content_areadef()[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_content_aux_data()[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_content_for_channel(ch_str, grid_type)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_geolocation_for_channel(data, ch_str, grid_type, n_rows_cols)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_image_data_for_channel(data, ch_str, n_rows_cols)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_index_map_for_channel(data, ch_str, n_rows_cols)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_pixel_quality_for_channel(data, ch_str, n_rows_cols)[source]
satpy.tests.reader_tests.test_fci_l1c_nc._get_test_segment_position_for_channel(data, ch_str, n_rows_cols)[source]
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.fill_chans_af()[source]

Fill the dict CHANS_AF and the list TEST_FILENAMES with the right channel and resolution.

satpy.tests.reader_tests.test_fci_l1c_nc.generate_parameters(calibration)[source]

Generate dinamicaly the parameters.

satpy.tests.reader_tests.test_fci_l1c_nc.get_list_channel_calibration(calibration)[source]

Get the channel’s list according the calibration.

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.

satpy.tests.reader_tests.test_fci_l1c_nc.resolutions(channel)[source]

Get the resolutions.