Skip to content

Commit

Permalink
Add a unittest check for proper motion correction
Browse files Browse the repository at this point in the history
The loadPixelBox() funtion can be passed an epoch parameter, in which
case the reference catalog coordiantes are to up corrected for proper
motion (to the epoch provided).  This checks that this correction is
indeed being applied (using an extreme value for the epoch such that
the differences will be significant and reasnoably tested to have
changed via assertFloatsNotEqual).
  • Loading branch information
laurenam committed Jan 8, 2021
1 parent b06c87a commit a8b8138
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_htmIndex.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ def testLoadPixelBox(self):
cdMatrix = afwGeom.makeCdMatrix(scale=pixel_scale)
wcs = afwGeom.makeSkyWcs(crval=cent, crpix=ctr_pix, cdMatrix=cdMatrix)
result = loader.loadPixelBox(bbox=bbox, wcs=wcs, filterName="a")
# The following is to ensure the reference catalog coords are
# getting corrected for proper motion when an epoch is provided.
# Use an extreme epoch so that differences in corrected coords
# will be significant.
resultWithEpoch = loader.loadPixelBox(bbox=bbox, wcs=wcs, filterName="a",
epoch=astropy.time.Time(20000, format='mjd', scale="tai"))
self.assertFloatsNotEqual(result.refCat["coord_ra"], resultWithEpoch.refCat["coord_ra"],
rtol=1.0e-4)
self.assertFloatsNotEqual(result.refCat["coord_dec"], resultWithEpoch.refCat["coord_dec"],
rtol=1.0e-4)
self.assertFalse("camFlux" in result.refCat.schema)
self.assertGreaterEqual(len(result.refCat), len(idList))
numFound += len(result.refCat)
Expand Down

0 comments on commit a8b8138

Please sign in to comment.