From b9193575dd2917c40a724eca59b9f22098ff03c2 Mon Sep 17 00:00:00 2001 From: Austin Riba Date: Thu, 30 Oct 2025 11:07:58 -0700 Subject: [PATCH] High-eccentricity targets from JPL-H as MPC_COMET Makes passing on elements to SLALIB easier when dealing with high eccentricity targets from JPL horizons. Fixes #1180 --- tom_catalogs/harvesters/jplhorizons.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tom_catalogs/harvesters/jplhorizons.py b/tom_catalogs/harvesters/jplhorizons.py index fa5f8a84e..ad34d216c 100644 --- a/tom_catalogs/harvesters/jplhorizons.py +++ b/tom_catalogs/harvesters/jplhorizons.py @@ -27,7 +27,13 @@ def query(self, term, location=None, start=None, end=None, step=None): def to_target(self): target = super().to_target() target.type = 'NON_SIDEREAL' - target.scheme = 'MPC_MINOR_PLANET' + # Special case for ingesting asteroids as comets, see tom_base #1180 + target.eccentricity = self.catalog_data['e'][0] # eccentricity in JPL + target.epoch_of_perihelion = self.jd_to_mjd(self.catalog_data['Tp_jd'][0]) # time of periapsis in JPL + if target.eccentricity > 0.9 and target.epoch_of_perihelion is not None and target.epoch_of_perihelion != 0: + target.scheme = 'MPC_COMET' + else: + target.scheme = 'MPC_MINOR_PLANET' asteroid = True if 'M1' in self.catalog_data.colnames and 'k1' in self.catalog_data.colnames: asteroid = False @@ -47,10 +53,8 @@ def to_target(self): target.inclination = self.catalog_data['incl'][0] # inclination in JPL target.mean_daily_motion = self.catalog_data['n'][0] # mean motion in JPL target.semimajor_axis = self.catalog_data['a'][0] # semi-major axis in JPL - target.eccentricity = self.catalog_data['e'][0] # eccentricity in JPL # epoch Julian Date in JPL target.epoch_of_elements = self.jd_to_mjd(self.catalog_data['datetime_jd'][0]) - target.epoch_of_perihelion = self.jd_to_mjd(self.catalog_data['Tp_jd'][0]) # time of periapsis in JPL target.perihdist = self.catalog_data['q'][0] # periapsis distance in JPL # undocumented in JPL astroquery column names -- presuming P is the orbital period in JPL target.ephemeris_period = self.catalog_data['P'][0]