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

Test parallax correction for clearsky case (returns NaN).

test_get_parallax_corrected_lonlats_cloudy_slant()[source]

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

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

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

test_get_parallax_corrected_lonlats_mixed()[source]

Test parallax correction for mixed cloudy case.

test_get_parallax_corrected_lonlats_ssp()[source]

Test that at SSP, parallax correction does nothing.

test_get_surface_parallax_displacement()[source]

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

Test cloudy correction when areas have no overlap.

test_correct_area_cloudy_partly_shifted()[source]

Test cloudy correction when areas overlap only partly.

test_correct_area_cloudy_same_area()[source]

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_correct_area_partlycloudy(daskify)[source]

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.

test_area(request)[source]

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_modifier_interface_fog_no_shift(test_area)[source]

Test that fog isn’t masked or shifted.

test_parallax_modifier_interface()[source]

Test the modifier interface.

test_parallax_modifier_interface_with_cloud()[source]

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 https://github.com/pytroll/satpy/pull/1904#issuecomment-1011161623 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.

fake_scene(yaml_code)[source]

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.

yaml_code()[source]

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

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

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

  • resolution (float) – Resolution of fake area.

Returns:

List of areas.

satpy.tests.modifier_tests.test_parallax.fake_tle()[source]

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