Skip to content

Commit

Permalink
add cdInverseAtPixel to ConstantFitsWcs
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Mar 19, 2018
1 parent aaf082c commit 58a721d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tractor/tractortime.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class TAITime(ScalarParam, ArithmeticParams):
MJD = TAI/(24*3600)
'''
equinox = 53084.28 # mjd
daysperyear = 365.25
equinox = 53084.28 # mjd of the spring equinox in 2004
daysperyear = 365.25 # Julian years, by definition

mjd2k = datetomjd(J2000)

Expand Down
5 changes: 5 additions & 0 deletions tractor/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def __init__(self, wcs):

cd = self.wcs.get_cd()
self.cd = np.array([[cd[0], cd[1]], [cd[2], cd[3]]])

self.cd_inverse = np.linalg.inv(cd)
self.pixscale = self.wcs.pixel_scale()

def hashkey(self):
Expand Down Expand Up @@ -219,6 +221,9 @@ def cdAtPixel(self, x, y):
'''
return self.cd

def cdInverseAtPixel(self, x, y):
return self.cd_inverse

def pixel_scale(self):
return self.pixscale

Expand Down

0 comments on commit 58a721d

Please sign in to comment.