From 7b9dd201423216ce85a76ed13659fda0c8057bde Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Mon, 13 Dec 2021 09:59:30 -0600 Subject: [PATCH] Cleanup comments --- landsat/combine.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/landsat/combine.py b/landsat/combine.py index 8bb4079..977d28e 100644 --- a/landsat/combine.py +++ b/landsat/combine.py @@ -2,16 +2,18 @@ import os import rasterio -# Open the first directory, could walk entire tree +# Open the first directory in data, could walk entire tree for dirname, dirs, files in os.walk('data'): source = dirs[0] break +# Open band (B2/Blue) and copy metadata for result. with rasterio.open("data/%s/%s_B2.TIF" % (source, source)) as band2: meta = band2.meta +# Combine bands into PNG meta.update(count = 3, driver='PNG') with rasterio.open('output/result.png', 'w+', **meta) as output: for i in range(1, 4): print(i) - output.write_band(i,rasterio.open("data/%s/%s_B%d.TIF" % (source, source, i+3)).read(1)) # Red + output.write_band(i,rasterio.open("data/%s/%s_B%d.TIF" % (source, source, i+3)).read(1))