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'))
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'))
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'))
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'))
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'))
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())