From 83c98594b3e569d9ee93c430ccb60435e4ca49b6 Mon Sep 17 00:00:00 2001 From: David Kaplan Date: Fri, 29 Sep 2023 12:58:05 -0500 Subject: [PATCH] fix when no POSEPOCH defined --- src/pint/models/astrometry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pint/models/astrometry.py b/src/pint/models/astrometry.py index 55371fc03..2a76c7bf3 100644 --- a/src/pint/models/astrometry.py +++ b/src/pint/models/astrometry.py @@ -465,7 +465,7 @@ def ssb_to_psb_xyz_ICRS(self, epoch=None): # Instead look at what https://docs.astropy.org/en/stable/_modules/astropy/coordinates/sky_coordinate.html#SkyCoord.apply_space_motion # does, which is to use https://github.com/liberfa/erfa/blob/master/src/starpm.c # and then just use the relevant pieces of that - if epoch is None or self.POSEPOCH is None: + if epoch is None or self.POSEPOCH.quantity is None: return self.coords_as_ICRS(epoch=epoch).cartesian.xyz.transpose() epoch = ( epoch if isinstance(epoch, Time) else Time(epoch, scale="tdb", format="mjd") @@ -888,7 +888,7 @@ def ssb_to_psb_xyz_ECL(self, epoch=None, ecl=None): if ecl is not None and ecl != self.ECL.quantity: return super().ssb_to_psb_xyz_ECL(epoch=epoch, ecl=ecl) - if epoch is None or self.POSEPOCH is None: + if epoch is None or self.POSEPOCH.quantity is None: return self.coords_as_ECL(epoch=epoch, ecl=ecl).cartesian.xyz.transpose() epoch = ( epoch if isinstance(epoch, Time) else Time(epoch, scale="tdb", format="mjd")