def get_file_extension(gdalformat):
    """
    A function to get the extension for a given file format
    (NOTE, currently only KEA, GTIFF, HFA, PCI and ENVI are supported).

    :return: string

    """
    ext = ".NA"
    if gdalformat.lower() == "kea":
        ext = ".kea"
    elif gdalformat.lower() == "gtiff":
        ext = ".tif"
    elif gdalformat.lower() == "hfa":
        ext = ".img"
    elif gdalformat.lower() == "envi":
        ext = ".env"
    elif gdalformat.lower() == "pcidsk":
        ext = ".pix"
    else:
        raise Exception("The extension for the gdalformat specified is unknown.")
    return ext