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.
- class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGDataset[source]
Bases:
object
Tests for getting the dataset.
- test_repeat_cycle_duration(file_handler)[source]
Test repeat cycle handling for FD or ReduscedScan.
- 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.
- class satpy.tests.reader_tests.test_seviri_l1b_native.TestNativeMSGFilenames[source]
Bases:
object
Test identification of Native format filenames.
- 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.
- 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 callingrecarray2dict()
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.