def planted(fk_candidate_observations, planted_objects, tolerance=10):
    """
    Using the fk_candidate_observations as input get the Object.planted file from VOSpace and match
    planted sources with found sources.

    The Object.planted list is pulled from VOSpace based on the standard file-layout and name of the
    first exposure as read from the .astrom file.

    :param fk_candidate_observations: name of the fk*reals.astrom file to check against Object.planted
    :param planted_objects: object containing the planted object information.

    """

    found_pos = []
    detections = fk_candidate_observations.get_sources()
    for detection in detections:
        reading = detection.get_reading(0)
        # create a list of positions, to be used later by match_lists
        found_pos.append([reading.x, reading.y])

    # The match_list method expects a list that contains a position, not an x and a y vector, so we transpose.
    planted_objects_table = planted_objects.table
    planted_pos = numpy.transpose([planted_objects_table['x'].data, planted_objects_table['y'].data])

    # match_idx is an order list.  The list is in the order of the first list of positions and each entry
    # is the index of the matching position from the second list.
    (match_idx, match_fnd) = util.match_lists(numpy.array(planted_pos), numpy.array(found_pos), tolerance=tolerance)
    return match_fnd, match_idx
def planted ( fk_candidate_observations , planted_objects , tolerance = 10 ) : found_pos = [ ] detections = fk_candidate_observations . get_sources ( ) for detection in detections : reading = detection . get_reading ( 0 ) found_pos . append ( [ reading . x , reading . y ] ) planted_objects_table = planted_objects . table planted_pos = numpy . transpose ( [ planted_objects_table [ 'x' ] . data , planted_objects_table [ 'y' ] . data ] ) ( match_idx , match_fnd ) = util . match_lists ( numpy . array ( planted_pos ) , numpy . array ( found_pos ) , tolerance = tolerance ) return match_fnd , match_idx
Using the fk_candidate_observations as input get the Object.planted file from VOSpace and match
    planted sources with found sources.

    The Object.planted list is pulled from VOSpace based on the standard file-layout and name of the
    first exposure as read from the .astrom file.

    :param fk_candidate_observations: name of the fk*reals.astrom file to check against Object.planted
    :param planted_objects: object containing the planted object information.