Skip to content

Commit

Permalink
Merge pull request #131 from lsst/tickets/DM-47303
Browse files Browse the repository at this point in the history
DM-47303: Add cameraGain config option and pipeline for building lookup table.
  • Loading branch information
erykoff authored Nov 21, 2024
2 parents 1635faa + 16417df commit 12f32b3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pipelines/LSSTComCam/fgcmMakeLUT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: Make LSSTComCam fgcmcal look-up table
instrument: lsst.obs.lsst.LsstComCam
imports:
- location: $FGCMCAL_DIR/pipelines/_ingredients/fgcmMakeLUT.yaml
3 changes: 3 additions & 0 deletions pipelines/_ingredients/fgcmMakeLUT.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: Make fgcmcal look-up table
tasks:
fgcmMakeLut: lsst.fgcmcal.fgcmMakeLut.FgcmMakeLutTask
7 changes: 7 additions & 0 deletions python/lsst/fgcmcal/fgcmFitCycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,13 @@ class FgcmFitCycleConfig(pipeBase.PipelineTaskConfig,
default=None,
optional=True,
)
cameraGain = pexConfig.Field(
doc="Average camera gain. If not set, will use the median of the "
"camera model/detector/amplifier gains.",
dtype=float,
default=None,
optional=True,
)
defaultCameraOrientation = pexConfig.Field(
doc="Default camera orientation for QA plots.",
dtype=float,
Expand Down
9 changes: 6 additions & 3 deletions python/lsst/fgcmcal/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ def makeConfigDict(config, log, camera, maxIter,
# Convert to square cm.
mirrorArea = config.mirrorArea * 100.**2.

# Get approximate average camera gain:
gains = [amp.getGain() for detector in camera for amp in detector.getAmplifiers()]
cameraGain = float(np.median(gains))
if config.cameraGain is None:
# Get approximate average camera gain:
gains = [amp.getGain() for detector in camera for amp in detector.getAmplifiers()]
cameraGain = float(np.median(gains))
else:
cameraGain = config.cameraGain

# Cut down the filter map to those that are in the LUT
filterToBand = {filterName: config.physicalFilterMap[filterName] for
Expand Down

0 comments on commit 12f32b3

Please sign in to comment.