def find_apass_stars(image, max_mag_error=0.05, max_color_error=0.1):
    # use the catalog_search function to find the apass stars in the frame of the image read above
    apass, apass_x, apass_y = catalog_search(image.wcs, image.shape,
                                             'II/336/apass9', 'RAJ2000',
                                             'DEJ2000', 1, False)

    # Creates a boolean array of the apass stars that have well defined magnitudes and color
    apass_bright = (apass['e_r_mag'] < max_mag_error) & (
        apass['e_B-V'] < max_color_error)  # & (apass['u_e_r_mag'] == 0)

    # create new lists of apass stars and x y pixel coordinates using boolean array
    apass_in_bright, in_apass_x, in_apass_y = apass[apass_bright], apass_x[
        apass_bright], apass_y[apass_bright]

    return apass, apass_x, apass_y, apass_in_bright, in_apass_x, in_apass_y
def find_stars_from_catalog(image, catatalog):
    cat, x, y = catalog_search(image.wcs, image.shap, catalog, 'RAJ2000',
                               'DEJ2000')
    return 0
def find_known_variables(image):
    # Get any known variable stars from a new catalog search of VSX
    vsx, vsx_x, vsx_y = catalog_search(image.wcs, image.shape, 'B/vsx/vsx',
                                       'RAJ2000', 'DEJ2000')
    vsx_names = vsx['Name']  # Get the names of the variables
    return vsx, vsx_x, vsx_y, vsx_names