Exemplo n.º 1
0
def NDVI():
    import time

    import matplotlib.pyplot as plt
    import matplotlib.image as mpimg
    from astropy.nddata import NDDataArray
    print("This programm will lead you through creating a NDVI map from images")
    print("It works under assumption that you input two images into it: A Red band image and Near infrared image")
    print("The images must be monochrome, cloudless and it would be best if they had a ocean mask applied.")
    print("If they contain clouds/waterbodies, those will also be falsely ranged on scale.")
    print("NIR is Band 4, R is Band 3 or broadband VIS")
    # pathNIR=input("Please input the path to near infrared image:    ")
    # pathR=input("Please input the path to red image:    ")
    print("Please select a color pallete you want to use. Available palletes:")
    print("Greens   Greys   hot    seismic")
    cmapN = input()

    r = mpimg.imread('C:/Users/Karol/Desktop/NIR.png')
    nir = mpimg.imread('C:/Users/Karol/Desktop/R.png')
    numerator = NDDataArray.subtract(nir, r)
    denominator = NDDataArray.add(nir, r)
    ndvi = NDDataArray.divide(numerator, denominator)
    plt.imshow(ndvi, cmap=cmapN)
    plt.colorbar()
    plt.show()
Exemplo n.º 2
0
def NOAADUST(ch4,ch5):
    numerator = NDDataArray.subtract(ch5, ch4)
    denominator = NDDataArray.add(ch4, ch5)
    dust = NDDataArray.divide(numerator, denominator)
    plt.imshow(dust,cmap="hot")
    plt.show()
    return dust