Skip to content

Commit

Permalink
Merge branch 'tickets/DM-37411'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenam committed Jan 5, 2023
2 parents 993ccb9 + 49a2505 commit 814d7e0
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
1 change: 1 addition & 0 deletions bin/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pipetask --long-log --log-level="$loglevel" qgraph \
-c calibrate:astrometry.maxMeanDistanceArcsec=0.025 \
-c calibrate:requireAstrometry=False \
-c calibrate:requirePhotoCal=False \
-c makeWarp:select.maxPsfTraceRadiusDelta=0.2 \
--save-qgraph "$QGRAPH_FILE"

pipetask --long-log --log-level="$loglevel" run \
Expand Down
10 changes: 9 additions & 1 deletion python/lsst/ci/hsc/gen3/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@
# 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.
ASTROMETRY_FALURE_DATA_IDS = [
ASTROMETRY_FAILURE_DATA_IDS = [
{'visit': 903344, 'detector': 0, 'physical_filter': 'HSC-R'},
{'visit': 903346, 'detector': 1, '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.
# This list is sensitive to (at least) the PSF algorithms and dataset under
# consideration, so may require updating if either of those change in the
# context of this repository.
PSF_MODEL_ROBUSTNESS_FAILURE_DATA_IDS = [
{'visit': 903334, 'detector': 22, 'physical_filter': 'HSC-R'},
]
74 changes: 74 additions & 0 deletions tests/test_psfModelTraceFail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This file is part of ci_hsc_gen3.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import os
import unittest

import lsst.utils.tests

from lsst.ci.hsc.gen3 import PSF_MODEL_ROBUSTNESS_FAILURE_DATA_IDS
from lsst.daf.butler import Butler, DataCoordinate
from lsst.utils import getPackageDir


class TestPsfModelTraceRadiusFails(lsst.utils.tests.TestCase):
"""Test the deselection of detectors based on PSF model robustness check.
"""
def setUp(self):
self.butler = Butler(os.path.join(getPackageDir("ci_hsc_gen3"), "DATA"), writeable=False,
collections=["HSC/calib/2013-06-17", "HSC/runs/ci_hsc"])
self.skymap = "discrete/ci_hsc"
self.tract = 0
self.patch = 69
self.band = "r"
self.coaddDataId = DataCoordinate.standardize(
instrument="HSC", skymap=self.skymap, tract=self.tract, patch=self.patch, band=self.band,
universe=self.butler.registry.dimensions,
)

def tearDown(self):
del self.butler
del self.skymap
del self.tract
del self.patch
del self.band
del self.coaddDataId

def testFailedPsfTraceRadiusDeltaNotInCoadd(self):
"""Check that the detectors failing the maxPsfTraceRadiusDelta
criterion are not included in the coadd.
"""
coadd = self.butler.get("deepCoadd_calexp", self.coaddDataId)
inputCcds = coadd.getInfo().getCoaddInputs().ccds
for failedDataId in PSF_MODEL_ROBUSTNESS_FAILURE_DATA_IDS:
visit = failedDataId["visit"]
detector = failedDataId["detector"]
failedMask = (inputCcds["visit"] == visit) & (inputCcds["ccd"] == detector)
self.assertTrue(sum(failedMask) == 0)


class MemoryTester(lsst.utils.tests.MemoryTestCase):
pass


if __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()
4 changes: 2 additions & 2 deletions tests/test_validate_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import os
import unittest

from lsst.ci.hsc.gen3 import DATA_IDS, ASTROMETRY_FALURE_DATA_IDS
from lsst.ci.hsc.gen3 import DATA_IDS, ASTROMETRY_FAILURE_DATA_IDS
from lsst.ci.hsc.gen3.tests import MockCheckMixin
from lsst.daf.butler import Butler
from lsst.utils import getPackageDir
Expand All @@ -36,7 +36,7 @@ def setUp(self):
writeable=False, collections=["HSC/runs/ci_hsc"])

self._num_exposures = len(DATA_IDS)
self._num_forced_astrom_failures = len(ASTROMETRY_FALURE_DATA_IDS)
self._num_forced_astrom_failures = len(ASTROMETRY_FAILURE_DATA_IDS)
self._num_exposures_good_templates = 29
self._num_visits = len({data_id["visit"] for data_id in DATA_IDS})
self._num_tracts = 1
Expand Down

0 comments on commit 814d7e0

Please sign in to comment.