satpy.tests.reader_tests.test_seviri_l1b_native module

Unittesting the Native SEVIRI reader.

class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGCalibration[source]

Bases: TestFileHandlerCalibrationBase

Unit tests for calibration.

file_handler()[source]

Create a mocked file handler.

test_calibrate(file_handler, counts, channel, calibration, calib_mode, use_ext_coefs)[source]

Test the calibration.

class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGDataset[source]

Bases: object

Tests for getting the dataset.

file_handler()[source]

Create a file handler for testing.

test_get_dataset(file_handler)[source]

Test getting the dataset.

test_get_dataset_with_raw_metadata(file_handler)[source]

Test provision of raw metadata.

test_repeat_cycle_duration(file_handler)[source]

Test repeat cycle handling for FD or ReduscedScan.

test_satpos_no_valid_orbit_polynomial(file_handler)[source]

Test satellite position if there is no valid orbit polynomial.

test_time(file_handler)[source]

Test start/end nominal/observation time handling.

class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGFileHandler(methodName='runTest')[source]

Bases: TestCase

Test the NativeMSGFileHandler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_get_available_channels()[source]

Test the derivation of the available channel list.

class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGFilenames[source]

Bases: object

Test identification of Native format filenames.

reader()[source]

Return reader for SEVIRI Native format.

test_file_pattern(reader)[source]

Test file pattern matching.

class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGPadder(methodName='runTest')[source]

Bases: TestCase

Test Padder of the native l1b seviri reader.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

static prepare_padder(test_dict)[source]

Initialize Padder and pad test data.

test_padder_fes_hrv()[source]

Test padder for FES HRV data.

test_padder_rss_roi()[source]

Test padder for RSS and ROI data (applies to both VISIR and HRV).

satpy.tests.reader_tests.test_seviri_l1b_native.amend_seviri_native_null_header(hdr_null_numpy)[source]

Amend the given null header so that the seviri_l1b_native reader can properly parse it.

This is achieved by setting values for the bare minimum number of header fields so that the reader can make sense of the given header. This function relies on a number of auxiliary functions all of which are enclosed in the body of the present function.

Note

The naming scheme of the auxiliary functions is as follows: _amend_<KEY1>__<KEY2>__..., where <KEY{n}> corresponds to keys in the header when it is represented as a dictionary, i.e. when calling recarray2dict() on the given header array.

For example, _amend_15_DATA_HEADER__SatelliteStatus__SatelliteDefinition__SatelliteId() corresponds to an auxiliary function which manipulates the following entry: hdr_null_numpy_as_dict["15_DATA_HEADER"]["SatelliteStatus"]["SatelliteDefinition"]["SatelliteId"]

satpy.tests.reader_tests.test_seviri_l1b_native.append_data_and_trailer_content_to_seviri_native_header(filename, hdr_null_numpy)[source]

Generate the data and trailer part (null content) of the file and appends them to the null header.

The data and trailer are also null and appending them to the header results in a complete seviri nat file.

satpy.tests.reader_tests.test_seviri_l1b_native.compress_seviri_native_file(tmp_seviri_nat_filename, session_tmp_path)[source]

Compress the given seviri native file into a zip file.

satpy.tests.reader_tests.test_seviri_l1b_native.create_physical_seviri_native_file(seviri_nat_full_file_path)[source]

Create a physical seviri native file on disk.

satpy.tests.reader_tests.test_seviri_l1b_native.create_test_header(earth_model, dataset_id, is_full_disk, is_rapid_scan, good_qual='OK')[source]

Create test header for SEVIRI L1.5 product.

Header includes mandatory attributes for NativeMSGFileHandler.get_area_extent

satpy.tests.reader_tests.test_seviri_l1b_native.create_test_trailer(is_rapid_scan)[source]

Create test trailer for SEVIRI L1.5 product.

Trailer includes mandatory attributes for NativeMSGFileHandler.get_area_extent

satpy.tests.reader_tests.test_seviri_l1b_native.generate_seviri_native_null_header()[source]

Generate the header of the seviri native format which is filled with zeros, hence the term null!

satpy.tests.reader_tests.test_seviri_l1b_native.prepare_area_definitions(test_dict)[source]

Prepare calculated and expected area definitions for equal checking.

satpy.tests.reader_tests.test_seviri_l1b_native.prepare_is_roi(test_dict)[source]

Prepare calculated and expected check for region of interest data for equal checking.

satpy.tests.reader_tests.test_seviri_l1b_native.scene_from_physical_seviri_nat_file(filename)[source]

Generate a Scene object from the given seviri native file.

satpy.tests.reader_tests.test_seviri_l1b_native.session_tmp_path(tmp_path_factory)[source]

Generate a single temp path to use for the entire session.

satpy.tests.reader_tests.test_seviri_l1b_native.test_area_definitions(actual, expected)[source]

Test area definitions with only one area.

satpy.tests.reader_tests.test_seviri_l1b_native.test_has_archive_header(starts_with, expected)[source]

Test if the file includes an ASCII archive header.

satpy.tests.reader_tests.test_seviri_l1b_native.test_header_type(file_content, exp_header_size)[source]

Test identification of the file header type.

satpy.tests.reader_tests.test_seviri_l1b_native.test_header_warning()[source]

Test warning is raised for NOK quality flag.

satpy.tests.reader_tests.test_seviri_l1b_native.test_is_roi(actual, expected)[source]

Test if given area is of area-of-interest.

satpy.tests.reader_tests.test_seviri_l1b_native.test_read_header()[source]

Test that reading header returns the header correctly converted to a dictionary.

satpy.tests.reader_tests.test_seviri_l1b_native.test_read_physical_seviri_nat_file(full_path)[source]

Test that the physical seviri native file can be read successfully, in case of both a plain and a zip file.

Note

The purpose of this function is not to fully test the properties of the scene. It only provides a test for reading a physical file from disk.

satpy.tests.reader_tests.test_seviri_l1b_native.test_stacked_area_definitions(actual, expected)[source]

Test area definitions with stacked areas.

satpy.tests.reader_tests.test_seviri_l1b_native.tmp_seviri_nat_filename(session_tmp_path)[source]

Create a fully-qualified filename for a seviri native format file.