Beispiel #1
0
 def test_generate_merged_output(self):
     merge = load_DataCube('tests/merged_cube.json').get_array()
     hasPV = merge[:, 3].dropna('t', how='all').t
     merge = merge.loc[{'t': hasPV.values}][19:21]
     merge = (merge * 100.).astype(numpy.int64).astype(numpy.float64) / 100.
     merge = merge.where(merge > -1.e10).where(merge < 1.e10)
     save_DataCube('tests/test01_merged.json', DataCube(merge))
     plot_xarray_dataarray(merge)
 def setUpClass(cls):
     super(TestPhenology, cls).setUpClass()
     cls.inpcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test03_smoothed.json'))
     cls.refcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test04_phenology.json'))
Beispiel #3
0
 def setUpClass(cls):
     super(TestSavitzkyGolaySmooth, cls).setUpClass()
     cls.inpcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test02_ganndvi.json'))
     cls.refcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test03_smoothed.json'))
Beispiel #4
0
 def setUpClass(cls):
     super(TestMergedSmoothAndPhenology, cls).setUpClass()
     cls.inpcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test02_ganndvi.json'))
     cls.refcube = load_DataCube(
         os.path.join(os.path.dirname(__file__), 'test04_phenology.json'))
Beispiel #5
0
 def test_generate_phenology_output(self):
     merge = load_DataCube('tests/vito_phenology.json')
     merge = reduceXY(16, 16, merge).get_array()
     save_DataCube('tests/test04_phenology.json', DataCube(merge))
     plot_timeseries(merge.drop('x').drop('y'))
Beispiel #6
0
 def test_generate_smoothed_output(self):
     merge = load_DataCube('tests/smoothed_cube.json')
     merge = reduceXY(16, 16, merge).get_array()
     save_DataCube('tests/test03_smoothed.json', DataCube(merge))
     plot_timeseries(merge.drop('x').drop('y'))
Beispiel #7
0
 def test_LoadSave(self):
     cube1 = DataCube(self.build_array(32, 16))
     save_DataCube('/tmp/test_LoadSave.json', cube1)
     cube2 = load_DataCube('/tmp/test_LoadSave.json')
     xarray.testing.assert_allclose(cube1.get_array(), cube2.get_array())