From 8171aacf34e6c44b51849e73dc8614b0b26d66cc Mon Sep 17 00:00:00 2001 From: John Parejko Date: Wed, 11 Sep 2024 14:57:53 -0700 Subject: [PATCH] DM-46272 prep: don't force astrometry failures Until we've fully figured out how to handle partial outputs in DRP tasks downstream of calibrateImage, we can't use this to test failed astrometry. --- bin/pipeline.sh | 4 +++- python/lsst/ci/hsc/gen3/data.py | 4 +++- tests/test_astrometryFail.py | 8 +++++++- ...test_calibrateImage.py => test_reprocessVisitImage.py} | 0 4 files changed, 13 insertions(+), 3 deletions(-) rename tests/{test_calibrateImage.py => test_reprocessVisitImage.py} (100%) diff --git a/bin/pipeline.sh b/bin/pipeline.sh index d056596..0fcc856 100755 --- a/bin/pipeline.sh +++ b/bin/pipeline.sh @@ -54,12 +54,14 @@ HIPS_QGRAPH_FILE=$(mktemp)_hips.qgraph trap 'rm -f $QGRAPH_FILE $INJECTION_QGRAPH_FILE $FARO_QGRAPH_FILE $RESOURCE_USAGE_QGRAPH_FILE \ $HIPS_QGRAPH_FILE' EXIT +# DM-46272: Change maxMeanDistanceArcsec to something smaller, so that it fails; +# even better, move those settings into DRP-ci_hsc.yaml! pipetask --long-log --log-level="$loglevel" qgraph \ -d "skymap='discrete/ci_hsc' AND tract=0 AND patch=69" \ -b "$repo"/butler.yaml \ --input "$INPUTCOLL" --output "$COLLECTION" \ -p "$DRP_PIPE_DIR/pipelines/HSC/DRP-ci_hsc.yaml" \ - -c calibrateImage:astrometry.maxMeanDistanceArcsec=0.020 \ + -c calibrateImage:astrometry.maxMeanDistanceArcsec=0.20 \ -c makeDirectWarp:select.maxPsfTraceRadiusDelta=0.2 \ --save-qgraph "$QGRAPH_FILE" diff --git a/python/lsst/ci/hsc/gen3/data.py b/python/lsst/ci/hsc/gen3/data.py index d6e1763..d3121ea 100644 --- a/python/lsst/ci/hsc/gen3/data.py +++ b/python/lsst/ci/hsc/gen3/data.py @@ -58,8 +58,10 @@ # set. This list is sensitive to the astrometry algorithms and dataset # under consideration, so may require updating if either of those change # in the context of this repository. +# DM-46272: not forcing these failures until we can handle partial outputs; +# uncomment this line as that ticket is sorted out. ASTROMETRY_FAILURE_DATA_IDS = [ - {'visit': 903344, 'detector': 0, 'physical_filter': 'HSC-R'}, + # {'visit': 903344, 'detector': 0, 'physical_filter': 'HSC-R'}, ] # The following lists the dataIds that fail the PSF Model robustness check # with the config override makeWarp.select.maxPsfTraceRadiusDelta=0.2 set. diff --git a/tests/test_astrometryFail.py b/tests/test_astrometryFail.py index 84cbdab..5643a87 100644 --- a/tests/test_astrometryFail.py +++ b/tests/test_astrometryFail.py @@ -29,6 +29,8 @@ from lsst.utils import getPackageDir +# DM-46272: not forcing these failures until we can handle partial outputs; +# remove the expectedFailures as that ticket is sorted out. class TestAstrometryFails(lsst.utils.tests.TestCase): """Tests the outputs of the forced astrometry failures. """ @@ -45,6 +47,7 @@ def setUp(self): universe=self.butler.dimensions, ) + @unittest.expectedFailure def testWcsAndPhotoCalibIsNoneForFailedAstrom(self): """Test the WCS and photoCalib objects attached to failed WCS exposure. @@ -61,6 +64,7 @@ def testWcsAndPhotoCalibIsNoneForFailedAstrom(self): pviPhotoCalib = self.butler.get("initial_pvi.photoCalib", self.pviMinimalDataId) self.assertTrue(pviPhotoCalib is None) + @unittest.expectedFailure def testSrcCoordsAreNanForFailedAstrom(self): """Test coord values in all source catalogs. @@ -76,11 +80,12 @@ def testSrcCoordsAreNanForFailedAstrom(self): sourceCat = self.butler.get("initial_stars_footprints_detector", self.pviMinimalDataId) self.assertTrue(np.all(np.isnan(sourceCat["coord_ra"]))) self.assertTrue(np.all(np.isnan(sourceCat["coord_dec"]))) - for catStr in ["source", "sourceTable"]: + for catStr in ["sources", "sourceTable"]: sourceCat = self.butler.get(catStr, self.pviMinimalDataId) self.assertFalse(np.all(np.isnan(sourceCat["coord_ra"]))) self.assertFalse(np.all(np.isnan(sourceCat["coord_dec"]))) + @unittest.expectedFailure def testCentroidsAreNotNanForFailedAstrom(self): """Test that at least some catalog centroids have finite values. @@ -99,6 +104,7 @@ def testCentroidsAreNotNanForFailedAstrom(self): self.assertFalse(np.all(np.isnan(sourceCat["x"]))) self.assertFalse(np.all(np.isnan(sourceCat["y"]))) + @unittest.expectedFailure def testVisitCoordsAreNanForFailedAstrom(self): """Test coord and astrom values for visitTable and visitSummary. diff --git a/tests/test_calibrateImage.py b/tests/test_reprocessVisitImage.py similarity index 100% rename from tests/test_calibrateImage.py rename to tests/test_reprocessVisitImage.py