satpy.tests.modifier_tests.test_parallax module

Tests related to parallax correction.

class satpy.tests.modifier_tests.test_parallax.TestForwardParallax[source]

Bases: object

Test the forward parallax function with various inputs.


Test parallax correction for clearsky case (returns NaN).


Test parallax correction for fully cloudy scene (not SSP).

test_get_parallax_corrected_lonlats_cloudy_ssp(lat, lon, resolution)[source]

Test parallax correction for fully cloudy scene at SSP.


Test that exception is raised if satellites exactly at the horizon.

Test the rather unlikely case of a satellite elevation of exactly 0


Test parallax correction for mixed cloudy case.


Test that at SSP, parallax correction does nothing.


Test surface parallax displacement.

class satpy.tests.modifier_tests.test_parallax.TestParallaxCorrectionClass[source]

Bases: object

Test that the ParallaxCorrection class is behaving sensibly.

test_correct_area_clearsky(sat_pos, ar_pos, resolution, caplog)[source]

Test that ParallaxCorrection doesn’t change clearsky geolocation.

test_correct_area_clearsky_different_resolutions(res1, res2)[source]

Test clearsky correction when areas have different resolutions.


Test cloudy correction when areas have no overlap.


Test cloudy correction when areas overlap only partly.


Test cloudy correction when areas are the same.

test_correct_area_no_orbital_parameters(caplog, fake_tle)[source]

Test ParallaxCorrection when CTH has no orbital parameters.

Some CTH products, such as NWCSAF-GEO, do not include information on satellite location directly. Rather, they include platform name, sensor, start time, and end time, that we have to use instead.


Test ParallaxCorrection for partly cloudy situation.

test_correct_area_ssp(lat, lon, resolution)[source]

Test that ParallaxCorrection doesn’t touch SSP.

test_init_parallaxcorrection(center, sizes, resolution)[source]

Test that ParallaxCorrection class can be instantiated.

class satpy.tests.modifier_tests.test_parallax.TestParallaxCorrectionModifier[source]

Bases: object

Test that the parallax correction modifier works correctly.

_get_fake_cloud_datasets(test_area, cth, use_dask)[source]

Return datasets for BT and CTH for fake cloud.


Produce test area for parallax correction unit tests.

Produce test area for the modifier-interface parallax correction unit tests.

test_modifier_interface_cloud_moves_to_observer(cth, use_dask, test_area)[source]

Test that a cloud moves to the observer.

With the modifier interface, use a high resolution area and test that pixels are moved in the direction of the observer and not away from it.


Test that fog isn’t masked or shifted.


Test the modifier interface.


Test the modifier interface with a cloud.

Test corresponds to a real bug encountered when using CTH data from NWCSAF-GEO, which created strange speckles in Africa (see for an example). Create fake CTH corresponding to NWCSAF-GEO area and BT corresponding to full disk SEVIRI, and test that no strange speckles occur.

class satpy.tests.modifier_tests.test_parallax.TestParallaxCorrectionSceneLoad[source]

Bases: object

Test that scene load interface works as expected.

conf_file(yaml_code, tmp_path)[source]

Produce a fake configuration file.


Produce fake scene and prepare fake composite config.

test_double_load(fake_scene, conf_file, fake_tle)[source]

Test that loading corrected and uncorrected works correctly.

When the modifier __call__ method fails to call self.apply_modifier_info(new, old) and the original and parallax-corrected dataset are requested at the same time, the DataArrays differ but the underlying dask arrays have object identity, which in turn leads to both being parallax corrected. This unit test confirms that there is no such object identity.

test_enhanced_image(fake_scene, conf_file, fake_tle)[source]

Test that image enhancement is the same.

test_no_compute(fake_scene, conf_file)[source]

Test that no computation occurs.


Return YAML code for parallax_corrected_VIS006.

satpy.tests.modifier_tests.test_parallax._get_attrs(lat, lon, height=35000)[source]

Get attributes for datasets in fake scene.

satpy.tests.modifier_tests.test_parallax._get_fake_areas(center, sizes, resolution, code=4326)[source]

Get multiple square areas with the same center.

Returns multiple square areas centered at the same location

  • center (Tuple[float, float]) – Center of all areass

  • sizes (List[int]) – Sizes of areas

  • resolution (float) – Resolution of fake area.


List of areas.


Produce fake Two Line Element (TLE) object from pyorbital.