satpy.tests.reader_tests.test_hrit_base module

The HRIT base reader tests package.

class satpy.tests.reader_tests.test_hrit_base.TestHRITDecompress(methodName='runTest')[source]

Bases: TestCase

Test the on-the-fly decompression.

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.

_classSetupFailed = False
_class_cleanups = []
test_decompress(popen)[source]

Test decompression works.

test_xrit_cmd()[source]

Test running the xrit decompress command.

test_xrit_outfile()[source]

Test the right decompression filename is used.

class satpy.tests.reader_tests.test_hrit_base.TestHRITFileHandler[source]

Bases: object

Test the HRITFileHandler.

setup_method(method)[source]

Set up the hrit file handler for testing.

test_get_area_def()[source]

Test getting an area definition.

test_get_area_extent()[source]

Test getting the area extent.

test_get_xy_from_linecol()[source]

Test get_xy_from_linecol.

test_read_band_FSFile(stub_hrit_file)[source]

Test reading a single band from an FSFile.

test_read_band_bzipped2_filepath(stub_bzipped_hrit_file)[source]

Test reading a single band from a bzipped file.

test_read_band_filepath(stub_hrit_file)[source]

Test reading a single band from a filepath.

test_read_band_gzip_stream(stub_gzipped_hrit_file)[source]

Test reading a single band from a gzip stream.

test_start_end_time()[source]

Test reading and converting start/end time.

class satpy.tests.reader_tests.test_hrit_base.TestHRITFileHandlerCompressed[source]

Bases: object

Test the HRITFileHandler with compressed segments.

test_read_band_filepath(stub_compressed_hrit_file)[source]

Test reading a single band from a filepath.

satpy.tests.reader_tests.test_hrit_base.create_stub_hrit(filename, open_fun=<built-in function open>, meta={'GP_SC_ID': 324, 'annotation_header': b'H-000-MSG4__-MSG4________-VIS006___-000001___-202208180730-C_', 'cds_p_field': 64, 'cfac': -13642337, 'coff': 1856, 'compression_flag_for_data': 0, 'data_field_length': 17223680, 'data_field_representation': 3, 'file_type': 0, 'image_segment_line_quality': array([(1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0),        (1, (0, 0), 1, 1, 0), (1, (0, 0), 1, 1, 0)],       dtype=[('line_number_in_grid', '>i4'), ('line_mean_acquisition', [('days', '>u2'), ('milliseconds', '>u4')]), ('line_validity', 'u1'), ('line_radiometric_quality', 'u1'), ('line_geometric_quality', 'u1')]), 'lfac': -13642337, 'loff': 1856, 'number_of_bits_per_pixel': 10, 'number_of_columns': 3712, 'number_of_lines': 464, 'orbital_parameters': {}, 'planned_end_segment_number': 8, 'planned_start_segment_number': 1, 'projection_name': b'GEOS(+000.0)                    ', 'projection_parameters': {'SSP_longitude': 0.0, 'a': 6378169.0, 'b': 6356583.8, 'h': 35785831.0}, 'segment_sequence_number': 1, 'spectral_channel_id': 1, 'timestamp': (23605, 27911151), 'total_header_length': 6198})[source]

Create a stub hrit file.

satpy.tests.reader_tests.test_hrit_base.fake_decompress(infile, outdir='.')[source]

Fake decompression.

satpy.tests.reader_tests.test_hrit_base.new_get_hd(instance, hdr_info)[source]

Generate some metadata.

satpy.tests.reader_tests.test_hrit_base.new_get_hd_compressed(instance, hdr_info)[source]

Generate some metadata.

satpy.tests.reader_tests.test_hrit_base.stub_bzipped_hrit_file(tmp_path)[source]

Create a stub bzipped hrit file.

satpy.tests.reader_tests.test_hrit_base.stub_compressed_hrit_file(tmp_path)[source]

Create a stub compressed hrit file.

satpy.tests.reader_tests.test_hrit_base.stub_gzipped_hrit_file(tmp_path)[source]

Create a stub gzipped hrit file.

satpy.tests.reader_tests.test_hrit_base.stub_hrit_file(tmp_path)[source]

Create a stub hrit file.