From 4012d84b6d1c30fcd83d14cb0a39b1627e918c79 Mon Sep 17 00:00:00 2001 From: Spandan Bhattacharya Date: Thu, 26 Mar 2026 21:45:57 +0530 Subject: [PATCH 1/3] Fix #1255: Add RA/DEC fallback for FOV plot when NASA Exoplanet Archive query fails --- exotic/exotic.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exotic/exotic.py b/exotic/exotic.py index f7001f9d..b5cc5def 100644 --- a/exotic/exotic.py +++ b/exotic/exotic.py @@ -1943,6 +1943,10 @@ def main(): if not args.override: nea_obj = NASAExoplanetArchive(planet=userpDict['pName']) userpDict['pName'], CandidatePlanetBool, pDict = nea_obj.planet_info() + if not pDict.get('ra') or not pDict.get('dec'): + log_info("NASA Archive coords missing. Falling back to inits.json RA/DEC.") + pDict['ra'] = userpDict.get('ra') + pDict['dec'] = userpDict.get('dec') else: pDict = userpDict CandidatePlanetBool = False From 2c3f132afe2ea8bf0abdf409fcadeaebccca05ca Mon Sep 17 00:00:00 2001 From: Spandan Bhattacharya Date: Thu, 26 Mar 2026 21:52:26 +0530 Subject: [PATCH 2/3] Fix #1255: Add RA/DEC fallback for FOV plot with missing-data handling --- exotic/exotic.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/exotic/exotic.py b/exotic/exotic.py index b5cc5def..7e4fce66 100644 --- a/exotic/exotic.py +++ b/exotic/exotic.py @@ -1943,10 +1943,19 @@ def main(): if not args.override: nea_obj = NASAExoplanetArchive(planet=userpDict['pName']) userpDict['pName'], CandidatePlanetBool, pDict = nea_obj.planet_info() + # --- Fallback to user-provided RA/Dec from inits.json if NASA Exoplanet Archive + # returns empty coordinates (e.g., for candidate planets or API failures). --- if not pDict.get('ra') or not pDict.get('dec'): - log_info("NASA Archive coords missing. Falling back to inits.json RA/DEC.") - pDict['ra'] = userpDict.get('ra') - pDict['dec'] = userpDict.get('dec') + user_ra = userpDict.get('ra') + user_dec = userpDict.get('dec') + + if user_ra is not None and user_dec is not None: + log_info("NASA Archive coords missing. Falling back to inits.json RA/DEC.") + pDict['ra'] = user_ra + pDict['dec'] = user_dec + else: + log_info("WARNING: NASA Archive coords missing AND no RA/DEC provided in inits.json. FOV plot may fail.") + # --------------------------------- else: pDict = userpDict CandidatePlanetBool = False From 998d85a33969f2b58a41807c5394db362abad0e4 Mon Sep 17 00:00:00 2001 From: Spandan Bhattacharya Date: Fri, 27 Mar 2026 00:29:10 +0530 Subject: [PATCH 3/3] Fix #1255: Handle NoneType pDict for candidate planets in interactive mode --- exotic/exotic.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/exotic/exotic.py b/exotic/exotic.py index 7e4fce66..2378fc72 100644 --- a/exotic/exotic.py +++ b/exotic/exotic.py @@ -1943,8 +1943,11 @@ def main(): if not args.override: nea_obj = NASAExoplanetArchive(planet=userpDict['pName']) userpDict['pName'], CandidatePlanetBool, pDict = nea_obj.planet_info() - # --- Fallback to user-provided RA/Dec from inits.json if NASA Exoplanet Archive - # returns empty coordinates (e.g., for candidate planets or API failures). --- + + # --- V2 SOTA FALLBACK (FIXED FOR CANDIDATES) --- + if pDict is None: + pDict = {} + if not pDict.get('ra') or not pDict.get('dec'): user_ra = userpDict.get('ra') user_dec = userpDict.get('dec') @@ -1954,8 +1957,8 @@ def main(): pDict['ra'] = user_ra pDict['dec'] = user_dec else: - log_info("WARNING: NASA Archive coords missing AND no RA/DEC provided in inits.json. FOV plot may fail.") - # --------------------------------- + log_info("WARNING: NASA Archive coords missing AND no RA/DEC provided. FOV plot may fail.") + # ----------------------------------------------- else: pDict = userpDict CandidatePlanetBool = False