def test_get_images(self): provider = MPIBGCProvider(CubeConfig(end_time=datetime(2001, 12, 31, 23, 0)), dir=SOURCE_DIR + "/GPP", var="GPPall") provider.prepare() images = provider.compute_variable_images(datetime(2001, 1, 1), datetime(2001, 1, 9)) self.assertIsNotNone(images) self.assertTrue('gross_primary_productivity' in images) image = images['gross_primary_productivity'] self.assertEqual((720, 1440), image.shape)
def test_get_high_res_images(self): provider = MPIBGCProvider( CubeConfig(grid_width=4320, grid_height=2160, spatial_res=1 / 12, end_time=datetime(2001, 12, 31, 23, 0)), dir=SOURCE_DIR + "/NEE", var="NEE") provider.prepare() images = provider.compute_variable_images(datetime(2001, 1, 1), datetime(2001, 1, 9)) self.assertIsNotNone(images) self.assertTrue('net_ecosystem_exchange' in images) image = images['net_ecosystem_exchange'] self.assertEqual((2160, 4320), image.shape)