def test_fractional_cover(sr_filepath, fc_filepath):
print(sr_filepath)
print(fc_filepath)
sr_dataset = open_dataset(sr_filepath)
measurements = [
{'name': 'PV', 'dtype': 'int8', 'nodata': -1, 'units': 'percent'},
{'name': 'NPV', 'dtype': 'int8', 'nodata': -1, 'units': 'percent'},
{'name': 'BS', 'dtype': 'int8', 'nodata': -1, 'units': 'percent'},
{'name': 'UE', 'dtype': 'int8', 'nodata': -1, 'units': '1'}
]
fc_dataset = fractional_cover(sr_dataset, measurements)
assert set(fc_dataset.data_vars.keys()) == {m['name'] for m in measurements}
validation_ds = open_dataset(fc_filepath)
assert validation_ds == fc_dataset
assert validation_ds.equals(fc_dataset)
评论列表
文章目录