From 2fc609f1a3235f338449e5a563672e39ab9fac61 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Thu, 20 Oct 2022 22:24:08 -0700 Subject: [PATCH] Placed the call to tess_stars2px_function_entry inside a try/except block because it will error if one of the sectors is not in range. --- src/tess_locator/locate.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/tess_locator/locate.py b/src/tess_locator/locate.py index 209f7c3..f04d519 100644 --- a/src/tess_locator/locate.py +++ b/src/tess_locator/locate.py @@ -44,19 +44,23 @@ def locate( dec = np.atleast_1d(target.dec.to("deg").value) result = [] for idx in range(len(ra)): - ( - _, - _, - _, - out_sector, - out_camera, - out_ccd, - out_col, - out_row, - scinfo, - ) = tess_stars2px_function_entry( - 0, ra[idx], dec[idx], trySector=sectors_to_search[idx], aberrate=aberrate - ) + # tess_stars2px_function_entry will error if sector is not in range + try: + ( + _, + _, + _, + out_sector, + out_camera, + out_ccd, + out_col, + out_row, + scinfo, + ) = tess_stars2px_function_entry( + 0, ra[idx], dec[idx], trySector=sectors_to_search[idx], aberrate=aberrate + ) + except: + continue for idx_out in range(len(out_sector)): if out_sector[idx_out] < 0: