def test__RasterNumpy_map_access__if(): test_a = pygrass.RasterNumpy(name="test_a", mtype="CELL", mode="r+") test_a.open() test_c = pygrass.RasterNumpy(name="test_c", mtype="CELL", mode="w+", overwrite=True) test_c.open() test_c = test_a > 50 test_a.close() test_c.close()
def test__RasterNumpy_row_access__if(): test_a = pygrass.RasterNumpy(name="test_a", mtype="CELL", mode="r+") test_a.open() test_c = pygrass.RasterNumpy(name="test_c", mtype="CELL", mode="w+", overwrite=True) test_c.open() for row in xrange(test_a.rows): test_c[row] = test_a[row] > 50 test_a.close() test_c.close()
def test__RasterNumpy_map_access__add(): test_a = pygrass.RasterNumpy(name="test_a", mode="r+") test_a.open() test_b = pygrass.RasterNumpy(name="test_b", mode="r+") test_b.open() test_c = pygrass.RasterNumpy(name="test_c", mtype="DCELL", mode="w+", overwrite=True) test_c.open() test_c = test_a + test_b test_a.close() test_b.close() test_c.close()
def test__RasterNumpy_value_access__add(): test_a = pygrass.RasterNumpy(name="test_a", mode="r+") test_a.open() test_b = pygrass.RasterNumpy(name="test_b", mode="r+") test_b.open() test_c = pygrass.RasterNumpy(name="test_c", mtype="DCELL", mode="w+", overwrite=True) test_c.open() for row in xrange(test_a.rows): for col in xrange(test_a.cols): test_c[row, col] = test_a[row, col] + test_b[row, col] test_a.close() test_b.close() test_c.close()