satpy.tests.reader_tests.test_viirs_sdr module

Module for testing the satpy.readers.viirs_sdr module.

class satpy.tests.reader_tests.test_viirs_sdr.FakeHDF5FileHandler2(filename, filename_info, filetype_info, include_factors=True)[source]

Bases: FakeHDF5FileHandler

Swap-in HDF5 File Handler.

Create fake file handler.

static _add_basic_metadata_to_file_content(file_content, filename_info, num_grans)[source]
_add_data_info_to_file_content(file_content, filename, data_var_prefix, num_grans)[source]
static _add_geo_ref(file_content, filename)[source]
static _add_geolocation_info_to_file_content(file_content, filename, data_var_prefix, num_grans)[source]
_add_granule_specific_info_to_file_content(file_content, dataset_group, num_granules, num_scans_per_granule, gran_group_prefix)[source]
static _convert_numpy_content_to_dataarray(final_content)[source]
static _get_per_granule_lats()[source]
static _get_per_granule_lons()[source]
_num_scans_per_gran = [48]
_num_test_granules = 1
get_test_content(filename, filename_info, filetype_info)[source]

Mimic reader input file content.

class satpy.tests.reader_tests.test_viirs_sdr.FakeHDF5FileHandlerAggr(filename, filename_info, filetype_info, include_factors=True)[source]

Bases: FakeHDF5FileHandler2

Swap-in HDF5 File Handler with 4 VIIRS Granules per file.

Create fake file handler.

_num_scans_per_gran = [48, 48, 48, 48]
_num_test_granules = 4
class satpy.tests.reader_tests.test_viirs_sdr.FakeShortHDF5FileHandlerAggr(filename, filename_info, filetype_info, include_factors=True)[source]

Bases: FakeHDF5FileHandler2

Fake file that has less scans than usual in a couple granules.

Create fake file handler.

_num_scans_per_gran = [47, 48, 47]
_num_test_granules = 3
class satpy.tests.reader_tests.test_viirs_sdr.TestAggrVIIRSSDRReader(methodName='runTest')[source]

Bases: TestCase

Test VIIRS SDR 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.

_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Wrap HDF5 file handler with our own fake handler.

tearDown()[source]

Stop wrapping the HDF5 file handler.

test_bounding_box()[source]

Test bounding box.

yaml_file = 'viirs_sdr.yaml'
class satpy.tests.reader_tests.test_viirs_sdr.TestShortAggrVIIRSSDRReader(methodName='runTest')[source]

Bases: TestCase

Test VIIRS SDR Reader with a file that has truncated granules.

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 = []
setUp()[source]

Wrap HDF5 file handler with our own fake handler.

tearDown()[source]

Stop wrapping the HDF5 file handler.

test_load_truncated_band()[source]

Test loading a single truncated band.

yaml_file = 'viirs_sdr.yaml'
class satpy.tests.reader_tests.test_viirs_sdr.TestVIIRSSDRReader(methodName='runTest')[source]

Bases: TestCase

Test VIIRS SDR 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.

_assert_bt_properties(data_arr, num_scans=16, with_area=True)[source]
_assert_dnb_radiance_properties(data_arr, with_area=True)[source]
_assert_reflectance_properties(data_arr, num_scans=16, with_area=True)[source]
_classSetupFailed = False
_class_cleanups = []
setUp()[source]

Wrap HDF5 file handler with our own fake handler.

tearDown()[source]

Stop wrapping the HDF5 file handler.

test_init()[source]

Test basic init with no extra parameters.

test_init_end_time_beyond()[source]

Test basic init with end_time before the provided files.

test_init_start_end_time()[source]

Test basic init with end_time before the provided files.

test_init_start_time_beyond()[source]

Test basic init with start_time after the provided files.

test_init_start_time_is_nodate()[source]

Test basic init with start_time being set to the no-date 1/1-1958.

test_load_all_i_bts()[source]

Load all I band brightness temperatures.

test_load_all_i_radiances()[source]

Load all I band radiances.

test_load_all_i_reflectances_provided_geo()[source]

Load all I band reflectances with geo files provided.

test_load_all_m_bts()[source]

Load all M band brightness temperatures.

test_load_all_m_radiances()[source]

Load all M band radiances.

test_load_all_m_reflectances_find_geo()[source]

Load all M band reflectances with geo files not specified but existing.

test_load_all_m_reflectances_no_geo()[source]

Load all M band reflectances with no geo files provided.

test_load_all_m_reflectances_provided_geo()[source]

Load all M band reflectances with geo files provided.

test_load_all_m_reflectances_use_nontc()[source]

Load all M band reflectances but use non-TC geolocation.

test_load_all_m_reflectances_use_nontc2()[source]

Load all M band reflectances but use non-TC geolocation because TC isn’t available.

test_load_dnb()[source]

Load DNB dataset.

test_load_dnb_no_factors()[source]

Load DNB dataset with no provided scale factors.

test_load_dnb_sza_no_factors()[source]

Load DNB solar zenith angle with no scaling factors.

The angles in VIIRS SDRs should never have scaling factors so we test it that way.

test_load_i_no_files()[source]

Load I01 when only DNB files are provided.

yaml_file = 'viirs_sdr.yaml'
satpy.tests.reader_tests.test_viirs_sdr._touch_geo_file(prefix)[source]
satpy.tests.reader_tests.test_viirs_sdr.touch_geo_files(*prefixes)[source]

Create and then remove VIIRS SDR geolocation files.