test_fractional_cover.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:fc 作者: GeoscienceAustralia 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号