Пример #1
0
 def test_basic_default_provided(self):
     """Test default limits when SZA is provided."""
     from satpy.composites import SunZenithCorrector
     comp = SunZenithCorrector(name='sza_test', modifiers=tuple())
     res = comp((self.ds1, self.sza), test_attr='test')
     np.testing.assert_allclose(
         res.values,
         np.array([[22.401667, 22.31777], [22.437503, 22.353533]]))
Пример #2
0
 def test_basic_lims_provided(self):
     """Test custom limits when SZA is provided."""
     from satpy.composites import SunZenithCorrector
     comp = SunZenithCorrector(name='sza_test',
                               modifiers=tuple(),
                               correction_limit=90)
     res = comp((self.ds1, self.sza), test_attr='test')
     np.testing.assert_allclose(
         res.values,
         np.array([[66.853262, 68.168939], [66.30742, 67.601493]]))
Пример #3
0
 def test_basic_default_not_provided(self):
     """Test default limits when SZA isn't provided."""
     from satpy.composites import SunZenithCorrector
     comp = SunZenithCorrector(name='sza_test', modifiers=tuple())
     res = comp((self.ds1, ), test_attr='test')
     np.testing.assert_allclose(
         res.values,
         np.array([[22.401667, 22.31777], [22.437503, 22.353533]]))
     self.assertIn('y', res.coords)
     self.assertIn('x', res.coords)
     ds1 = self.ds1.copy()
     del ds1.coords['y']
     del ds1.coords['x']
     res = comp((ds1, ), test_attr='test')
     np.testing.assert_allclose(
         res.values,
         np.array([[22.401667, 22.31777], [22.437503, 22.353533]]))
     self.assertNotIn('y', res.coords)
     self.assertNotIn('x', res.coords)