Skip to content

Commit

Permalink
Post-review fixups.
Browse files Browse the repository at this point in the history
Improve documentation/comments on usage of "checkAllCcds".
  • Loading branch information
erykoff committed Aug 29, 2019
1 parent 245f2b3 commit 33c027e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions python/lsst/fgcmcal/fgcmBuildStars.py
Expand Up @@ -117,7 +117,9 @@ class FgcmBuildStarsConfig(pexConfig.Config):
default=13,
)
checkAllCcds = pexConfig.Field(
doc="Check all CCDs. Necessary for testing",
doc=("Check repo for existence of all possible ccds, in case when we have "
"incomplete visits and the referenceCCD will be missing. Primarily "
"used in testing."),
dtype=bool,
default=False,
)
Expand Down Expand Up @@ -483,14 +485,28 @@ def findAndGroupDataRefs(self, butler, dataRefs):
# will be unnecessary with Gen3 Butler. This should be part of
# DM-13730.

# Note that self.config.checkAllCcds means that we will check the repo
# for existence of all possible ccds for each (incomplete) visit, in cases
# when the referenceCCD will be missing (primarily during testing).

# scanAllCcds is a local flag that is set when the dataRefs do not include
# all relevant ccds.

scanAllCcds = False
if len(dataRefs) == 0:
if not self.config.checkAllCcds:
# These dataRefs include all possible visits, for each
# referenceCCD. This is much faster than scanning through
# all CCDs when none of them have been processed in a given repo.
dataRefs = butler.subset('src',
dataId={self.config.ccdDataRefName:
self.config.referenceCCD})
scanAllCcds = True
else:
# These dataRefs include all possible ccds
# Note that in the Gen2 era (at least) a valid dataRef in a subset
# only says that a given raw is available, and the src may not
# be accessible or processed in a specific repo.
dataRefs = butler.subset('src')

groupedDataRefs = {}
Expand All @@ -501,7 +517,7 @@ def findAndGroupDataRefs(self, butler, dataRefs):
continue
# If we need to scan all ccds, do it here
if scanAllCcds:
dataId = dataRef.dataId
dataId = dataRef.dataId.copy()
for ccdId in ccdIds:
dataId[self.config.ccdDataRefName] = ccdId
if butler.datasetExists('src', dataId=dataId):
Expand Down

0 comments on commit 33c027e

Please sign in to comment.