def test_get_images(self):
     provider = SnowWaterEquivalentProvider(CubeConfig(), dir=SOURCE_DIR)
     provider.prepare()
     images = provider.compute_variable_images(datetime(2010, 1, 1), datetime(2010, 12, 31))
     self.assertIsNotNone(images)
     self.assertTrue('snow_water_equivalent' in images)
     image = images['snow_water_equivalent']
     self.assertEqual((720, 1440), image.shape)
     self.assertEqual(0, np.isnan(image).sum())
 def test_get_high_res_images(self):
     provider = SnowWaterEquivalentProvider(CubeConfig(grid_width=4320, grid_height=2160, spatial_res=1 / 12),
                                            dir=SOURCE_DIR)
     provider.prepare()
     images = provider.compute_variable_images(datetime(2010, 1, 1), datetime(2010, 12, 31))
     self.assertIsNotNone(images)
     self.assertTrue('snow_water_equivalent' in images)
     image = images['snow_water_equivalent']
     self.assertEqual((2160, 4320), image.shape)
     self.assertEqual(0, np.isnan(image).sum())
예제 #3
0
 def test_get_images(self):
     provider = SnowWaterEquivalentProvider(CubeConfig(), dir=SOURCE_DIR)
     provider.prepare()
     images = provider.compute_variable_images(datetime(2010, 1, 1),
                                               datetime(2010, 12, 31))
     self.assertIsNotNone(images)
     self.assertTrue('snow_water_equivalent' in images)
     image = images['snow_water_equivalent']
     self.assertEqual((720, 1440), image.shape)
     self.assertEqual(0, np.isnan(image).sum())
예제 #4
0
 def test_get_high_res_images(self):
     provider = SnowWaterEquivalentProvider(CubeConfig(grid_width=4320,
                                                       grid_height=2160,
                                                       spatial_res=1 / 12),
                                            dir=SOURCE_DIR)
     provider.prepare()
     images = provider.compute_variable_images(datetime(2010, 1, 1),
                                               datetime(2010, 12, 31))
     self.assertIsNotNone(images)
     self.assertTrue('snow_water_equivalent' in images)
     image = images['snow_water_equivalent']
     self.assertEqual((2160, 4320), image.shape)
     self.assertEqual(0, np.isnan(image).sum())