def test_basic_no_sharpen(self): """Test that color None does no sharpening.""" from satpy.composites import RatioSharpenedRGB comp = RatioSharpenedRGB(name='true_color', high_resolution_band=None) res = comp((self.ds1, self.ds2, self.ds3), optional_datasets=(self.ds4, )) self.assertEqual(res.shape, (3, 2, 2))
def test_match_data_arrays(self): """Test that all of the areas have to be the same resolution.""" from satpy.composites import RatioSharpenedRGB, IncompatibleAreas comp = RatioSharpenedRGB(name='true_color') self.assertRaises(IncompatibleAreas, comp, (self.ds1, self.ds2, self.ds3), optional_datasets=(self.ds4_big, ))
def test_more_than_three_datasets(self): """Test that only 3 datasets can be passed.""" from satpy.composites import RatioSharpenedRGB comp = RatioSharpenedRGB(name='true_color') self.assertRaises(ValueError, comp, (self.ds1, self.ds2, self.ds3, self.ds1), optional_datasets=(self.ds4_big, ))
def test_basic_red(self): """Test that basic high resolution red can be passed.""" from satpy.composites import RatioSharpenedRGB comp = RatioSharpenedRGB(name='true_color') res = comp((self.ds1, self.ds2, self.ds3), optional_datasets=(self.ds4,)) res = res.values self.assertEqual(res.shape, (3, 2, 2)) np.testing.assert_allclose(res[0], self.ds4.values) np.testing.assert_allclose(res[1], np.array([[4.5, 4.5], [4.5, 4.5]], dtype=np.float64)) np.testing.assert_allclose(res[2], np.array([[6, 6], [6, 6]], dtype=np.float64))
def test_basic_no_high_res(self): """Test that three datasets can be passed without optional high res.""" from satpy.composites import RatioSharpenedRGB comp = RatioSharpenedRGB(name='true_color') res = comp((self.ds1, self.ds2, self.ds3)) self.assertEqual(res.shape, (3, 2, 2))