Commit 0241d74a authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

ndvi sh p3

parent 3221d5e1
...@@ -18,8 +18,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile): ...@@ -18,8 +18,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile):
rows, cols, geotransform = nir.RasterYSize, nir.RasterXSize, nir.GetGeoTransform() rows, cols, geotransform = nir.RasterYSize, nir.RasterXSize, nir.GetGeoTransform()
# # Read the input bands as numpy arrays. # # Read the input bands as numpy arrays.
np_nir = nir.GetRasterBand(1).ReadAsArray(0,0,nir.RasterXSize, nir.RasterYSize) np_nir = nir.GetRasterBand(1).ReadAsArray(0,0,nir.RasterXSize, nir.RasterYSize)
np_red = red.GetRasterBand(1).ReadAsArray(0,0,red.RasterXSize, red.RasterYSize) np_red = red.GetRasterBand(1).ReadAsArray(0,0,red.RasterXSize, red.RasterYSize)
# Convert the np arrays to 32-bit floating point to make sure division will occur properly. # Convert the np arrays to 32-bit floating point to make sure division will occur properly.
np_nir_as32 = np_nir.astype(np.float32) np_nir_as32 = np_nir.astype(np.float32)
...@@ -39,8 +39,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile): ...@@ -39,8 +39,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile):
output = driverTiff.Create(outfile, cols, rows, 1, gdal.GDT_Byte) output = driverTiff.Create(outfile, cols, rows, 1, gdal.GDT_Byte)
# output = driverTiff.CreateCopy(outfile+".tiff", nir, strict=0) # output = driverTiff.CreateCopy(outfile+".tiff", nir, strict=0)
# output = driverJP2.CreateCopy(outfile, nir, strict=0) # output = driverJP2.CreateCopy(outfile, nir, strict=0)
output.GetRasterBand(1).SetNoDataValue(-99) output.GetRasterBand(1).SetNoDataValue(-99)
output.GetRasterBand(1).WriteArray(result) output.GetRasterBand(1).WriteArray(result)
output.GetRasterBand(1).FlushCache() output.GetRasterBand(1).FlushCache()
output.SetGeoTransform(geotransform) output.SetGeoTransform(geotransform)
output = None output = None
......
...@@ -48,7 +48,7 @@ do ...@@ -48,7 +48,7 @@ do
fileout1=$(echo $filepattern | cut -d"_" -f1) fileout1=$(echo $filepattern | cut -d"_" -f1)
fileout2=$(echo $filepattern | cut -d"_" -f2) fileout2=$(echo $filepattern | cut -d"_" -f2)
python $HOME/git/GeoSentinel/geosentinel/ndvi.py $NIR $VIR ndvi/$fileout2"_"$fileout1".tiff" python3 $HOME/git/GeoSentinel/geosentinel/ndvi.py $NIR $VIR ndvi/$fileout2"_"$fileout1".tiff"
# convert $filepattern"04.jpg" $filepattern"03.jpg" $filepattern"02.jpg" -resize 640x480\! -combine video/$fileout2"_"$fileout1".jpg" # convert $filepattern"04.jpg" $filepattern"03.jpg" $filepattern"02.jpg" -resize 640x480\! -combine video/$fileout2"_"$fileout1".jpg"
if [ ! -d "video" ]; then if [ ! -d "video" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment