I had reclassified("Reclassify by table" in QGIS) the SWIR1 band value for a coastal erosion project to differentiate the land and the water better uisng QGIS and then replaced the SWIR1.tiff file in the bands directory. Then indexed without changing the MTL.txt, ANG.txt and the dataset documentation file(.yaml). The bands were downloaded from USGS. I tried to plot the Modified Normalized Difference Water Index(MNDWI) using the green band and swir1 using both rasterio and ODC(after indexing). Both gave me different results :
MNDWI calculated using the following lines of code : Rasterio :
mndwi = (green.astype('f4') - swir1.astype('f4'))/(green.astype('f4') + swir1.astype('f4'))
ODC :
ds = ds.assign(MNDWI = lambda ds: (ds.green[0] - ds.swir1[0]) / (ds.green[0] + ds.swir1[0]))
ds.MNDWI.attrs = ds.green.attrs
What could be the reason for the difference in results? Could it be to do with the dataset documentation file and indexing?