Created
July 29, 2016 17:50
-
-
Save celoyd/e7c7bfa0e88197df4cd405741a754f9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rasterio as rio | |
from sys import argv | |
from skimage import io | |
import numpy as np | |
# Reads an image with a bunch of bands (i.e., layers on the z axis) | |
# and returns an image with one band, each value in which is the mean | |
# along the z axis at that x,y. | |
with rio.open(argv[1]) as src: | |
lidar = src.read() | |
flat = np.mean(lidar, axis=0) | |
io.imsave('flat.tif', flat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment