-
Notifications
You must be signed in to change notification settings - Fork 6
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
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
python/lsst/obs/lsst/script/write_comcam_manual_defects.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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 | ||
|
||
# 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() | ||
for det in camera: | ||
detId = det.getId() | ||
detName = det.getName() | ||
|
||
# This is only valid for LSSTComCam which has a single raft | ||
manual_defects = \ | ||
Defects.readText('obs_lsst_data/comCam/manual_defects/r22_s'+detName[5:]+'/20241120T000000.ecsv') | ||
|
||
butler.put(manual_defects, "manual_defects", | ||
instrument="LSSTComCam", detector=detId, | ||
run=collection_output) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be redundant with the changes in
obs_base
that make these curated calibrations that are ingested into the butler withbutler write-curated-calibrations
. The files are small, and doing it this way means we can generate (and regenerate) the defects prior this this merging, so I don't think it's that big of a deal.However, I think this would be better getting the path dynamically, like we do in other scripts like this (https://github.com/lsst/obs_lsst/blob/main/python/lsst/obs/lsst/script/write_latiss_crosstalk_coeffs.py#L42 for reference).
getPackageDir
andos.join
make it safer to construct paths like this, as it will use whicheverobs_lsst_data
source is set up.