Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47365: new manual defects for LSSTComCam #584

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions python/lsst/obs/lsst/script/write_comcam_manual_defects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This file is part of obs_lsst.
#
# 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/>.

from lsst.daf.butler import Butler
from lsst.ip.isr import Defects
import lsst.obs.lsst as ol
import os
import lsst.utils

# Read and put new manual defects into the butler.
# We have to use embargo_old because
# this is where the CP needed for defects are.
camera_name = 'LSSTComCam'
butler = Butler('/repo/embargo_old', writeable=True)
collection_output = 'LSSTComCam/calib/DM-47365/addManualDefects/manualDefects.20241121c/run'
butler.registry.registerRun(collection_output)

cc = ol.LsstComCam
camera = cc.getCamera()

directory = lsst.utils.getPackageDir("obs_lsst_data")

for det in camera:
detId = det.getId()
detName = det.getName()

manualDefectsPath = os.path.join(directory, "comCam", "manual_defects", detName.lower())

# This is only valid for LSSTComCam which has a single raft
manual_defects = \
Defects.readText(manualDefectsPath+'/20241020T000000.ecsv')

butler.put(manual_defects, "manual_defects",
instrument="LSSTComCam", detector=detId,
run=collection_output)
Loading