Skip to content

Commit

Permalink
fix when no POSEPOCH defined
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakaplan committed Sep 29, 2023
1 parent c81591a commit 83c9859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pint/models/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 83c9859

Please sign in to comment.