Skip to content

Commit

Permalink
Update to use median psfSigma over the FOV.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Mar 3, 2021
1 parent 41c876e commit dafdad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions python/lsst/fgcmcal/fgcmBuildStarsBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def _findAndGroupDataRefsGen2(self, butler, camera, dataRefs):
Parameters
----------
butler : `lsst.daf.persistence.Butler`
Gen2 butler when used as CommandLineTask
Gen2 butler.
camera : `lsst.afw.cameraGeom.Camera`
Camera from the butler.
dataRefs : `list` of `lsst.daf.persistence.ButlerDataRef`
Expand Down Expand Up @@ -557,20 +557,26 @@ def _fillVisitCatalog(self, visitCat, groupedDataRefs, bkgDataRefDict=None,
psfSigma = psf.computeShape().getDeterminantRadius()
else:
# Gen3: use the visitSummary dataRef
summ = dataRef.get()
summary = dataRef.get()

detectors = list(summ['detector_id'])
detectors = list(summary['detector_id'])

try:
index = detectors.index(self.config.referenceCCD)
except ValueError:
# Take first available ccd if reference isn't available
index = 0

visitInfo = summ[index].getVisitInfo()
physicalFilter = summ[index]['physical_filter']
psfSigma = summ[index]['psfSigma']
visitInfo = summ[index].getVisitInfo()
visitInfo = summary[index].getVisitInfo()
physicalFilter = summary[index]['physical_filter']
# Compute the median psf sigma if possible
goodSigma, = np.where(summary['psfSigma'] > 0)
if goodSigma.size > 2:
psfSigma = np.median(summary['psfSigma'][goodSigma])
elif goodSigma > 0:
psfSigma = np.mean(summary['psfSigma'][goodSigma])
else:
psfSigma = 0.0

rec = visitCat[i]
rec['visit'] = visit
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/fgcmcal/fgcmBuildStarsTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
sourceTableRefs = inputRefDict['sourceTable_visit']

self.log.info("Running with %d sourceTable_visit dataRefs",
(len(sourceTableRefs)))
len(sourceTableRefs))

sourceTableDataRefDict = {sourceTableRef.dataId['visit']: sourceTableRef for
sourceTableRef in sourceTableRefs}
Expand Down

0 comments on commit dafdad2

Please sign in to comment.