def test_read_ds_data(): expected = 151.0 gdal.AllRegister() data_source = gdal.Open(DS_FILENAME, GA_ReadOnly) actual = geods.read_ds_data(data_source, 529, 477) assert abs(expected - actual) <= EPSILON
def test_read_ds_data_np(): expected = np.array([195, 182, 176, 177, 175, 160, 136, 130, 109, 113]) gdal.AllRegister() data_source = gdal.Open(DS_FILENAME, GA_ReadOnly) actual = geods.read_ds_data(data_source, np.linspace(300, 400, 10, dtype=int), np.linspace(400, 300, 10, dtype=int)) for exp, act in zip(expected, actual): assert abs(exp - act) <= EPSILON