Skip to content

Commit

Permalink
Merge pull request #227 from lsst/tickets/DM-34863
Browse files Browse the repository at this point in the history
DM-34863: Update tests and remove gen2 code from obs_decam.
  • Loading branch information
erykoff committed Jul 20, 2022
2 parents a45eefa + 10a47ae commit 9c90925
Show file tree
Hide file tree
Showing 36 changed files with 498 additions and 2,778 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ decam/CALIB/defects
decam/CALIB/crosstalk
decam/CALIB/calibRegistry*
decam/crosstalk
decam/linearity
.vscode/
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- python -*-
from lsst.sconsUtils import scripts
scripts.BasicSConstruct("obs_decam", defaultTargets=scripts.DEFAULT_TARGETS + ("decam",),
disableCc=True)
disableCc=True, subDirList=['config', 'doc', 'pipelines', 'python', 'ups'])
3 changes: 0 additions & 3 deletions bin.src/ingestImagesDecam.py

This file was deleted.

5 changes: 0 additions & 5 deletions bin.src/runCrosstalkAlone.py

This file was deleted.

2 changes: 0 additions & 2 deletions config/isr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
import os.path

from lsst.obs.decam.crosstalk import DecamCrosstalkTask

config.datasetType = "raw"
config.fallbackFilterName = None
Expand Down Expand Up @@ -60,7 +59,6 @@

config.doCrosstalkBeforeAssemble = True
config.doCrosstalk = True
config.crosstalk.retarget(DecamCrosstalkTask)
config.crosstalk.minPixelToMask=45000.0
config.crosstalk.crosstalkMaskPlane="CROSSTALK"

Expand Down
1 change: 0 additions & 1 deletion decam/CALIB/_mapper

This file was deleted.

3 changes: 3 additions & 0 deletions decam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ The linearity table `linearity_table_v*.fits` is a standard DECam calibration fi
[DECam Community Pipeline Calibration Files](http://www.ctio.noao.edu/noao/content/decam-calibration-files).
Building the `obs_decam` package converts the linearity table to LSST linearizers `linearizer/*.fits`
by running `makeLinearizer.py`.

To convert inputs to the format suitable for `obs_decam_data`, run `makeLinearizer.py linearity_table_v0.4.fits` and `makeCrosstalkDecam.py DECam_xtalk_20130606.txt`.

72 changes: 0 additions & 72 deletions decam/SConscript

This file was deleted.

22 changes: 17 additions & 5 deletions decam/makeCrosstalkDecam.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
import os.path
import sys

import lsst.obs.decam
import lsst.ip.isr as ipIsr
from lsst.daf.base import PropertyList
from lsst.obs.decam import DecamMapper
from lsst.utils import getPackageDir


def getCrosstalkDir():
"""Get crosstalk directory in obs package for outputting data."""
return os.path.join(getPackageDir('obs_decam'), 'decam', 'crosstalk')


def makeDetectorCrosstalk(dataDict, force=False):
Expand All @@ -26,7 +32,7 @@ def makeDetectorCrosstalk(dataDict, force=False):
decamCT.updateMetadata(setDate=False, CALIBDATE='1970-01-01T00:00:00')

detName = dataDict['DETECTOR_NAME']
outDir = os.path.join(DecamMapper.getCrosstalkDir(), detName.lower())
outDir = os.path.join(getCrosstalkDir(), detName.lower())
if os.path.exists(outDir):
if not force:
print("Output directory %r exists; use --force to replace" % (outDir, ))
Expand Down Expand Up @@ -55,10 +61,16 @@ def readFile(crosstalkInfile):
RuntimeError :
Raised if the detector is not known.
"""
instrument = lsst.obs.decam.DarkEnergyCamera()
camera = instrument.getCamera()

ampIndexMap = {'A': 0, 'B': 1}
detMap = {f"ccd{key:02d}": value for key, value in DecamMapper.detectorNames.items()}
detMap = {}
detSerialMap = {}
for detector in camera:
detMap[f"ccd{detector.getId():02d}"] = detector.getName()
detSerialMap[detector.getName()] = detector.getId()
detMap['ccd61'] = 'N30'
detSerialMap = {value: key for key, value in DecamMapper.detectorNames.items()}
detSerialMap['N30'] = 61

outDict = dict()
Expand Down Expand Up @@ -131,7 +143,7 @@ def readFile(crosstalkInfile):

outDict = readFile(crosstalkInfile=cmd.crosstalkInfile)

crosstalkDir = DecamMapper.getCrosstalkDir()
crosstalkDir = getCrosstalkDir()
if os.path.exists(crosstalkDir):
if not cmd.force:
print("Output directory %r exists; use --force to replace" % (crosstalkDir, ))
Expand Down

0 comments on commit 9c90925

Please sign in to comment.