def check_image_in_supercell(site1, site2, supercell_size):
    """
    Checks whether site1 and site2 are periodic images of each other in the super cell structure given the size of the
    super cell
    :param site1: (Site) site in super cell
    :param site2: (Site) site in super cell
    :param supercell_size: (integer) side length of super cell (in unit cells)
    :return: (boolean) whether site1 and site2 are periodic images of each other in the super cell
    """
    is_image = False
    x1 = site1.frac_coords[0]
    x2 = site2.frac_coords[0]
    y1 = site1.frac_coords[1]
    y2 = site2.frac_coords[1]
    z1 = site1.frac_coords[2]
    z2 = site2.frac_coords[2]
    if round((x1 - x2) * supercell_size, 5).is_integer() and \
            round((y1 - y2) * supercell_size, 5).is_integer() and \
            round((z1 - z2) * supercell_size, 5).is_integer():
        is_image = True

    return is_image