Skip to content

Commit

Permalink
Add astrometry doRankUpdate tests to demonstrate it is safe.
Browse files Browse the repository at this point in the history
Cleanup setup of skip rank update tests to make their difference from the
"normal" tests with the rank update step.
  • Loading branch information
parejkoj committed Apr 17, 2018
1 parent 0415bc2 commit 8dc4db2
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions tests/test_jointcal_decam.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def test_jointcalTask_2_visits(self):

self._testJointcalTask(2, relative_error, self.dist_rms_absolute, pa1, metrics=metrics)

def test_jointcalTask_2_visits_constrainedAstrometry_no_photometry(self):
def setup_jointcalTask_2_visits_constrainedAstrometry_no_photometry(self):
"""Help keep the two constrainedAstrometry tests consistent and make
the difference between them more obvious."""
self.config = lsst.jointcal.jointcal.JointcalConfig()
self.config.photometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
self.config.astrometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
Expand All @@ -107,47 +109,53 @@ def test_jointcalTask_2_visits_constrainedAstrometry_no_photometry(self):
'astrometry_final_chi2': 2072.89,
'astrometry_final_ndof': 3970,
}
return relative_error, pa1, metrics

def test_jointcalTask_2_visits_constrainedAstrometry_no_photometry(self):
relative_error, pa1, metrics = self.setup_jointcalTask_2_visits_constrainedAstrometry_no_photometry()

self._testJointcalTask(2, relative_error, self.dist_rms_absolute, pa1, metrics=metrics)

def test_jointcalTask_2_visits_constrainedPhotometry(self):
def test_jointcalTask_2_visits_constrainedAstrometry_no_rank_update(self):
"""Demonstrate that skipping the rank update doesn't significantly affect astrometry.
"""
relative_error, pa1, metrics = self.setup_jointcalTask_2_visits_constrainedAstrometry_no_photometry()
self.config.astrometryDoRankUpdate = False

self._testJointcalTask(2, relative_error, self.dist_rms_absolute, pa1, metrics=metrics)

def setup_jointcalTask_2_visits_constrainedPhotometry_no_astrometry(self):
"""Help keep the two constrainedPhotometry tests consistent and make
the difference between them more obvious."""

self.config = lsst.jointcal.jointcal.JointcalConfig()
self.config.astrometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
self.config.photometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
self.config.photometryModel = "constrained"
self.config.sourceSelector['astrometry'].badFlags.append("base_PixelFlags_flag_interpolated")
self.config.doAstrometry = False
self.jointcalStatistics.do_astrometry = False

pa1 = 0.15
metrics = {'collected_photometry_refStars': 8189,
'selected_photometry_refStars': 773,
'associated_photometry_fittedStars': 8241,
'selected_photometry_fittedStars': 2261,
'selected_photometry_ccdImages': 17,
'photometry_final_chi2': 3487.39,
'photometry_final_ndof': 2190,
pa1 = 0.11
metrics = {'collected_photometry_refStars': 4865,
'selected_photometry_refStars': 661,
'associated_photometry_fittedStars': 6749,
'selected_photometry_fittedStars': 2044,
'selected_photometry_ccdImages': 14,
'photometry_final_chi2': 3066.22,
'photometry_final_ndof': 1998,
}

return pa1, metrics

def test_jointcalTask_2_visits_constrainedPhotometry(self):
pa1, metrics = self.setup_jointcalTask_2_visits_constrainedPhotometry_no_astrometry()

self._testJointcalTask(2, None, None, pa1, metrics=metrics)

def test_jointcalTask_2_visits_constrainedPhotometry_no_rank_update(self):
self.config = lsst.jointcal.jointcal.JointcalConfig()
self.config.astrometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
self.config.photometryRefObjLoader.retarget(LoadAstrometryNetObjectsTask)
self.config.photometryModel = "constrained"
pa1, metrics = self.setup_jointcalTask_2_visits_constrainedPhotometry_no_astrometry()
self.config.photometryDoRankUpdate = False
self.config.doAstrometry = False
self.jointcalStatistics.do_astrometry = False

pa1 = 0.15
metrics = {'collected_photometry_refStars': 8189,
'selected_photometry_refStars': 773,
'associated_photometry_fittedStars': 8241,
'selected_photometry_fittedStars': 2261,
'selected_photometry_ccdImages': 17,
'photometry_final_chi2': 3522.10,
'photometry_final_ndof': 2197,
}

self._testJointcalTask(2, None, None, pa1, metrics=metrics)

Expand Down

0 comments on commit 8dc4db2

Please sign in to comment.