Exemplo n.º 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)
Exemplo n.º 2
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'))
Exemplo n.º 3
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'))
Exemplo n.º 4
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())