Skip to content

Commit

Permalink
Merge pull request #90 from lsst/tickets/DM-37411-v24
Browse files Browse the repository at this point in the history
DM-37411-v24: backport PSF robustness summary stats
  • Loading branch information
TallJimbo authored Jan 18, 2023
2 parents 337fe9e + 44079dc commit 6198c6d
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pipetask --long-log --log-level="$loglevel" qgraph \
-b "$repo"/butler.yaml \
--input "$INPUTCOLL" --output "$COLLECTION" \
-p "$DRP_PIPE_DIR/pipelines/HSC/DRP-ci_hsc.yaml" \
-c makeWarp:select.maxPsfTraceRadiusDelta=0.2 \
--save-qgraph "$QGRAPH_FILE"

pipetask --long-log --log-level="$loglevel" run \
Expand Down
8 changes: 8 additions & 0 deletions python/lsst/ci/hsc/gen3/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@
{'visit': 903988, 'detector': 23, 'physical_filter': 'HSC-I'},
{'visit': 903988, 'detector': 24, 'physical_filter': 'HSC-I'},
]
# 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()

0 comments on commit 6198c6d

Please sign in to comment.