sot / sparkles

ACA review of star catalogs from proseco
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Handle catalogs with very few stars #124

Open jeanconn opened 5 years ago

jeanconn commented 5 years ago

It looks like sparkles will throw an unhandled exception on P2 for a one-star catalog

    661 
    662             # Probability of 2 or fewer stars => conservative fail criteria
--> 663             p2 = p_n_cum[2]
    664 
    665             if verbose:

IndexError: index 2 is out of bounds for axis 0 with size 2

and the geometry check fails if we don't have more than 2 guide stars

    774         min_dist = 500
    775         min_dist2 = min_dist ** 2
--> 776         for idxs in combinations(guide_idxs, n_guide - 2):
    777             for idx0, idx1 in combinations(idxs, 2):
    778                 # If any distance in this combination exceeds min_dist then

ValueError: r must be non-negative

These are basically fine to not handle in operational use with ORViewer (if the catalogs are that bad, an error and no catalog is probably fine) but I think we should just throw appropriate critical warnings and complete the review in these cases.

I can also try to handle these specific errors in yoshi (where this is coming up) but that seems the wrong place.

jeanconn commented 5 years ago

Oops, my mistake, the first error is a proseco issue not a sparkles one.