class_docstr: Test that the parallax correction modifier works correctly.
docstr: 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.
docstr_tok: ["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","."]
code: def test_modifier_interface_cloud_moves_to_observer(
      self, cth, use_dask, test_area
  ):
      """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.
      """
      from satpy.modifiers.parallax import ParallaxCorrectionModifier
  
      (fake_bt, fake_cth, cma) = self._get_fake_cloud_datasets(
          test_area, cth, use_dask=use_dask
      )
  
      # location of cloud in corrected data
      # this may no longer be rectangular!
      dest_mask = np.zeros(shape=test_area.shape, dtype="?")
      cloud_location = {
          "foroyar": {
              7500: (197, 202, 152, 172),
              15000: (239, 244, 165, 184),
          },
          "ouagadougou": {
              7500: (159, 164, 140, 160),
              15000: (163, 168, 141, 161),
          },
      }
      (x_lo, x_hi, y_lo, y_hi) = cloud_location[test_area.name][cth]
      dest_mask[x_lo:x_hi, y_lo:y_hi] = True
  
      modif = ParallaxCorrectionModifier(
          name="parallax_corrected_dataset",
          prerequisites=[fake_bt, fake_cth],
          optional_prerequisites=[],
          debug_mode=True,
      )
  
      res = modif([fake_bt, fake_cth], optional_datasets=[])
  
      assert fake_bt.attrs["area"] == test_area  # should not be changed
      assert res.attrs["area"] == fake_bt.attrs["area"]
      # confirm old cloud area now fill value
      # except where it overlaps with new cloud
      assert np.isnan(res.data[cma & (~dest_mask)]).all()
      # confirm rest of the area does not have fill values
      assert np.isfinite(res.data[~cma]).all()
      # confirm that rest of area pixel values did not change, except where
      # cloud arrived or originated
      delta = res - fake_bt
      assert (delta.data[~(cma | dest_mask)] == 0).all()
      # verify that cloud moved south.  Pointwise comparison might not work because
      # cloud may shrink.
      assert (
          res.attrs["area"].get_lonlats()[1][dest_mask]
      ).mean() < fake_bt.attrs["area"].get_lonlats()[1][cma].mean()
      # verify that all pixels at the new cloud location are indeed cloudy
      assert (res.data[dest_mask] < 250).all()
  
imports: import datetime
  import logging
  import math
  import os
  import unittest.mock
  import dask.array
  import dask.config
  import numpy
  import pyorbital.tlefile
  import pyresample.kd_tree
  import pytest
  import xarray
  from pyproj import Geod
  from pyresample import create_area_def
  import satpy.resample
  from satpy.tests.utils import xfail_skyfield_unstable_numpy2
  from satpy.writers import get_enhanced_image
label_desc: Use image node_id 6 for calling the TestParallaxCorrectionModifier obj's underlying member method code with example usage: obj.test_modifier_interface_cloud_moves_to_observer(cth, use_dask, test_area) without return types