Skip to content

Commit

Permalink
_ssb_to_psb_xyz_ICRS_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Sep 23, 2023
1 parent 1820ba6 commit 3c4fe07
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/pint/models/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,17 @@ def ssb_to_psb_xyz_ICRS(self, epoch=None):
# function in AstrometryEcliptic.
# As a stopgap measure, I am moving this computation to a cached pure function below.

# return self.coords_as_ICRS(epoch=epoch).cartesian.xyz.transpose()

return _ssb_to_psb_xyz_ICRS(
self.RAJ.quantity,
self.DECJ.quantity,
self.PMRA.quantity,
self.PMDEC.quantity,
self.POSEPOCH.quantity,
np.array(epoch),
)
if isinstance(self, AstrometryEcliptic):
return self.coords_as_ICRS(epoch=epoch).cartesian.xyz.transpose()
else:
return _ssb_to_psb_xyz_ICRS_eq(
self.RAJ.quantity,
self.DECJ.quantity,
self.PMRA.quantity,
self.PMDEC.quantity,
self.POSEPOCH.quantity,
np.array(epoch),
)

def ssb_to_psb_xyz_ECL(self, epoch=None, ecl=None):
"""Returns unit vector(s) from SSB to pulsar system barycenter under Ecliptic coordinates.
Expand Down Expand Up @@ -1136,7 +1137,7 @@ def as_ICRS(self, epoch=None):


@cached
def _ssb_to_psb_xyz_ICRS(ra, dec, pmra, pmdec, posepoch, epoch):
def _ssb_to_psb_xyz_ICRS_eq(ra, dec, pmra, pmdec, posepoch, epoch):
"""A cached version of `AstrometryEquatorial.ssb_to_psb_xyz_ICRS`.
This is used to avoid repeated calls since this function is expensive.
"""
Expand Down

0 comments on commit 3c4fe07

Please sign in to comment.