def compareRule(origFileName):
    """
    Function that applies a rule to a file name to be comparable to other file
    names. Basically it extracts the file name part to compare with others.
    Example: tif files that only differ in one character at the end, like
    038_FJB_1904-001a.tif and 038_FJB_1904-001b.tif
    """
    compareFileName = origFileName.decode('utf-8').rstrip('.tif')[:-1]
    return compareFileName