satpy.tests.enhancement_tests.test_enhancements module

Unit testing the enhancements functions, e.g. cira_stretch.

class satpy.tests.enhancement_tests.test_enhancements.TestColormapLoading[source]

Bases: object

Test utilities used with colormaps.

test_cmap_bad_mode(real_mode, forced_mode, filename_suffix)[source]

Test that reading colormaps with the wrong mode fails.

test_cmap_from_config_path(tmp_path)[source]

Test loading a colormap relative to a config path.

test_cmap_from_file(color_scale, colormap_mode, extra_kwargs, filename_suffix)[source]

Test that colormaps can be loaded from a binary file.

test_cmap_from_file_bad_shape()[source]

Test that unknown array shape causes an error.

test_cmap_from_trollimage()[source]

Test that colormaps in trollimage can be loaded.

test_cmap_list()[source]

Test that colors can be a list/tuple.

test_cmap_no_colormap()[source]

Test that being unable to create a colormap raises an error.

test_cmap_vrgb_as_rgba()[source]

Test that data created as VRGB still reads as RGBA.

class satpy.tests.enhancement_tests.test_enhancements.TestEnhancementStretch[source]

Bases: object

Class for testing enhancements in satpy.enhancements.

setup_method()[source]

Create test data used by every test.

tearDown()[source]

Clean up.

test_apply_enhancement(input_data_name, decorator, exp_call_cls)[source]

Test the ‘apply_enhancement’ utility function.

test_btemp_threshold()[source]

Test applying the cira_stretch.

test_cira_stretch()[source]

Test applying the cira_stretch.

test_colorize()[source]

Test the colorize enhancement function.

test_lookup()[source]

Test the lookup enhancement function.

test_merge_colormaps()[source]

Test merging colormaps.

test_palettize()[source]

Test the palettize enhancement function.

test_piecewise_linear_stretch()[source]

Test the piecewise_linear_stretch enhancement function.

test_reinhard()[source]

Test the reinhard algorithm.

test_three_d_effect()[source]

Test the three_d_effect enhancement function.

class satpy.tests.enhancement_tests.test_enhancements.TestTCREnhancement[source]

Bases: object

Test the AHI enhancement functions.

setup_method()[source]

Create test data.

test_jma_true_color_reproduction()[source]

Test the jma_true_color_reproduction enhancement.

satpy.tests.enhancement_tests.test_enhancements._generate_cmap_test_data(color_scale, colormap_mode)[source]
satpy.tests.enhancement_tests.test_enhancements._write_cmap_to_file(cmap_filename, cmap_data)[source]
satpy.tests.enhancement_tests.test_enhancements.closed_named_temp_file(**kwargs)[source]

Named temporary file context manager that closes the file after creation.

This helps with Windows systems which can get upset with opening or deleting a file that is already open.

satpy.tests.enhancement_tests.test_enhancements.fake_area()[source]

Return a fake 2×2 area.

satpy.tests.enhancement_tests.test_enhancements.identical_decorator(func)[source]

Decorate but do nothing.

satpy.tests.enhancement_tests.test_enhancements.run_and_check_enhancement(func, data, expected, **kwargs)[source]

Perform basic checks that apply to multiple tests.

satpy.tests.enhancement_tests.test_enhancements.test_nwcsaf_comps(fake_area, tmp_path, data)[source]

Test loading NWCSAF composites.

satpy.tests.enhancement_tests.test_enhancements.test_on_dask_array()[source]

Test the on_dask_array decorator.

satpy.tests.enhancement_tests.test_enhancements.test_on_separate_bands()[source]

Test the on_separate_bands decorator.

satpy.tests.enhancement_tests.test_enhancements.test_using_map_blocks()[source]

Test the using_map_blocks decorator.