satpy.tests.reader_tests.test_nwcsaf_nc module

Unittests for NWC SAF reader.

class satpy.tests.reader_tests.test_nwcsaf_nc.TestNcNWCSAFFileKeyPrefix[source]

Bases: object

Test the NcNWCSAF reader when using a file key prefix.

test_get_dataset_scales_and_offsets_palette_meanings_using_other_dataset(nwcsaf_pps_cmic_filehandler)[source]

Test that get_dataset() returns scaled palette_meanings using another dataset as scaling source.

test_get_dataset_uses_file_key_prefix(nwcsaf_pps_cmic_filehandler)[source]

Test that get_dataset() uses a file_key_prefix.

class satpy.tests.reader_tests.test_nwcsaf_nc.TestNcNWCSAFGeo[source]

Bases: object

Test the NcNWCSAF reader for Geo products.

test_end_time(nwcsaf_geo_ct_filehandler)[source]

Test the end time property.

test_get_area_def(nwcsaf_geo_ct_filehandler)[source]

Test that get_area_def() returns proper area.

test_get_area_def_km(nwcsaf_old_geo_ct_filehandler)[source]

Test that get_area_def() returns proper area when the projection is in km.

test_orbital_parameters_are_correct(nwcsaf_geo_ct_filehandler)[source]

Test that orbital parameters are present in the dataset attributes.

test_scale_dataset_attr_removal(nwcsaf_geo_ct_filehandler)[source]

Test the scaling of the dataset and removal of obsolete attributes.

test_scale_dataset_floating(nwcsaf_geo_ct_filehandler, attrs, expected)[source]

Test the scaling of the dataset with floating point values.

test_scale_dataset_floating_nwcsaf_geo_ctth(nwcsaf_geo_ct_filehandler)[source]

Test the scaling of the dataset with floating point values for CTTH NWCSAF/Geo v2016/v2018.

test_sensor_name_platform(nwcsaf_geo_ct_filehandler, platform, instrument)[source]

Test that the correct sensor name is being set.

test_sensor_name_sat_id(nwcsaf_geo_ct_filehandler, platform, instrument)[source]

Test that the correct sensor name is being set.

test_start_time(nwcsaf_geo_ct_filehandler)[source]

Test the start time property.

test_times_are_in_dataset_attributes(nwcsaf_geo_ct_filehandler)[source]

Check that start/end times are in the attributes of datasets.

class satpy.tests.reader_tests.test_nwcsaf_nc.TestNcNWCSAFPPS[source]

Bases: object

Test the NcNWCSAF reader for PPS products.

test_drop_xycoords(nwcsaf_pps_cmic_filehandler)[source]

Test the drop of x and y coords.

test_end_time(nwcsaf_pps_cmic_filehandler)[source]

Test the start time property.

test_get_dataset_can_handle_file_key_list(nwcsaf_pps_cmic_filehandler, nwcsaf_pps_cpp_filehandler)[source]

Test that get_dataset() can handle a list of file_keys.

test_get_dataset_raises_when_dataset_missing(nwcsaf_pps_cpp_filehandler)[source]

Test that get_dataset() raises an error when the requested dataset is missing.

test_get_dataset_scales_and_offsets(nwcsaf_pps_cpp_filehandler)[source]

Test that get_dataset() returns scaled and offseted data.

test_get_dataset_scales_and_offsets_palette_meanings_using_other_dataset(nwcsaf_pps_cpp_filehandler)[source]

Test that get_dataset() returns scaled palette_meanings with another dataset as scaling source.

test_get_dataset_uses_file_key_if_present(nwcsaf_pps_cmic_filehandler, nwcsaf_pps_cpp_filehandler)[source]

Test that get_dataset() uses a file_key if present.

test_get_palette_fill_value_color_added(nwcsaf_pps_ctth_filehandler)[source]

Test that get_dataset() returns scaled palette_meanings with fill_value_color added.

test_start_time(nwcsaf_pps_cmic_filehandler)[source]

Test the start time property.

satpy.tests.reader_tests.test_nwcsaf_nc._check_filehandler_area_def(file_handler, dsid)[source]
satpy.tests.reader_tests.test_nwcsaf_nc.create_cmic_file(path, filetype, attrs={'gdal_projection': '+proj=geos +a=6378137.000 +b=6356752.300 +lon_0=0.000000 +h=35785863.000', 'gdal_xgeo_low_right': 5566500.0, 'gdal_xgeo_up_left': -5569500.0, 'gdal_ygeo_low_right': 2653500.0, 'gdal_ygeo_up_left': 5437500.0, 'satellite_identifier': 'MSG4', 'source': 'NWC/GEO version v2021.1', 'sub-satellite_longitude': 0.0, 'time_coverage_end': '2023-01-18T10:42:22Z', 'time_coverage_start': '2023-01-18T10:39:17Z'})[source]

Create a cmic file.

satpy.tests.reader_tests.test_nwcsaf_nc.create_cot_pal_variable(nc_file, var_name)[source]

Create a palette variable.

satpy.tests.reader_tests.test_nwcsaf_nc.create_cot_variable(nc_file, var_name)[source]

Create a COT variable.

satpy.tests.reader_tests.test_nwcsaf_nc.create_cre_variables(nc_file, var_name)[source]

Create a CRE variable.

satpy.tests.reader_tests.test_nwcsaf_nc.create_ctth_alti_pal_variable_with_fill_value_color(nc_file, var_name)[source]

Create a palette variable.

satpy.tests.reader_tests.test_nwcsaf_nc.create_ctth_file(path, attrs={'gdal_projection': '+proj=geos +a=6378137.000 +b=6356752.300 +lon_0=0.000000 +h=35785863.000', 'gdal_xgeo_low_right': 5566500.0, 'gdal_xgeo_up_left': -5569500.0, 'gdal_ygeo_low_right': 2653500.0, 'gdal_ygeo_up_left': 5437500.0, 'satellite_identifier': 'MSG4', 'source': 'NWC/GEO version v2021.1', 'sub-satellite_longitude': 0.0, 'time_coverage_end': '2023-01-18T10:42:22Z', 'time_coverage_start': '2023-01-18T10:39:17Z'})[source]

Create a cmic file.

satpy.tests.reader_tests.test_nwcsaf_nc.create_ctth_variables(nc_file, var_name)[source]

Create a CRE variable.

satpy.tests.reader_tests.test_nwcsaf_nc.create_nwcsaf_geo_ct_file(directory, attrs={'gdal_projection': '+proj=geos +a=6378137.000 +b=6356752.300 +lon_0=0.000000 +h=35785863.000', 'gdal_xgeo_low_right': 5566500.0, 'gdal_xgeo_up_left': -5569500.0, 'gdal_ygeo_low_right': 2653500.0, 'gdal_ygeo_up_left': 5437500.0, 'nominal_product_time': '2023-01-18T10:30:00Z', 'satellite_identifier': 'MSG4', 'source': 'NWC/GEO version v2021.1', 'sub-satellite_longitude': 0.0, 'time_coverage_end': '2023-01-18T10:42:22Z', 'time_coverage_start': '2023-01-18T10:39:17Z'})[source]

Create a CT file.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_geo_ct_filehandler(nwcsaf_geo_ct_filename)[source]

Create a CT filehandler.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_geo_ct_filename(tmp_path_factory)[source]

Create a CT file and return the filename.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_old_geo_ct_filehandler(nwcsaf_old_geo_ct_filename)[source]

Create a CT filehandler.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_old_geo_ct_filename(tmp_path_factory)[source]

Create a CT file and return the filename.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_cmic_filehandler(nwcsaf_pps_cmic_filename)[source]

Create a CMIC filehandler.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_cmic_filename(tmp_path_factory)[source]

Create a CMIC file.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_cpp_filehandler(nwcsaf_pps_cpp_filename)[source]

Create a CPP filehandler.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_cpp_filename(tmp_path_factory)[source]

Create a CPP file.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_ctth_filehandler(nwcsaf_pps_ctth_filename)[source]

Create a CMIC filehandler.

satpy.tests.reader_tests.test_nwcsaf_nc.nwcsaf_pps_ctth_filename(tmp_path_factory)[source]

Create a CTTH file.