import copy


def create_annotation_data(save_data):
    """Returns the final annotation JSON which is a cleane dup version of the save JSON"""
    #annotation_data = save_data
    annotation_data = {}
    annotation_data["image"] = copy.deepcopy(save_data["image"])
    annotation_data["grid_cells"] = copy.deepcopy(save_data["grid_cells"])
    # remove ids from corners in PV modules
    try:
        for p in annotation_data["grid_cells"]:
            corners = p["corners"]
            for corner in corners:
                del corner["id"]
    except KeyError:
        pass
    return annotation_data