Skip to content

Commit

Permalink
Update to new id-indexed visitSummary catalog.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Mar 3, 2021
1 parent 1c7428d commit c698a31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 6 additions & 9 deletions python/lsst/fgcmcal/fgcmBuildStarsBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,13 @@ def _fillVisitCatalog(self, visitCat, groupedDataRefs, bkgDataRefDict=None,
# Gen3: use the visitSummary dataRef
summary = dataRef.get()

detectors = list(summary['detector_id'])
summaryRow = summary.find(self.config.referenceCCD)
if summaryRow is None:
# Take the first available ccd if reference isn't available
summaryRow = summary[0]

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

visitInfo = summary[index].getVisitInfo()
physicalFilter = summary[index]['physical_filter']
visitInfo = summaryRow.getVisitInfo()
physicalFilter = summaryRow['physical_filter']
# Compute the median psf sigma if possible
goodSigma, = np.where(summary['psfSigma'] > 0)
if goodSigma.size > 2:
Expand Down
4 changes: 3 additions & 1 deletion python/lsst/fgcmcal/fgcmBuildStarsTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class FgcmBuildStarsTableConnections(pipeBase.PipelineTaskConnections,
)

visitSummary = connectionTypes.Input(
doc="Per-visit summary statistics table",
doc=("Per-visit consolidated exposure metadata. These catalogs use "
"detector id for the id and are sorted for fast lookups of a "
"detector."),
name="visitSummary",
storageClass="ExposureCatalog",
dimensions=("instrument", "visit"),
Expand Down

0 comments on commit c698a31

Please sign in to comment.