I'm working on getting the NDVI value of Landsat imagery 2018 using band 4 and 5 but I have encountered a slight problem.
import osgeo
from osgeo import gdal#gdal, data conversion tool
from matplotlib import pyplot as plt
import sys
import numpy as np#for reading numbers in python
b8a= gdal.Open('C:\\Users\\zack\\GIS PROGRAMMINGWORKS\\LC08_L1TP_168061_20171228_20180103_01_T1_B5.tiff')
b4= gdal.Open('C:\\Users\zack\\GIS PROGRAMMINGWORKS\\LC08_L1TP_168061_20171228_20180103_01_T1_B4.tiff')
d8a = b8a.GetRasterBand(1)
d4 = b4.GetRasterBand(1)
Error returned:
AttributeError Traceback (most recent call last)
<ipython-input-22-cb1cfc43017d> in <module>
----> 1 d8a = b8a.GetRasterBand(1)
2 d4 = b4.GetRasterBand(1)
AttributeError: 'NoneType' object has no attribute 'GetRasterBand'