1 from __future__
import absolute_import, division, print_function
10 """Get a butler into the Task scripts""" 13 """Task.run should receive a butler in the kwargs""" 14 return TaskRunner.getTargetList(parsedCmd, butler=parsedCmd.butler, **kwargs)
18 """Construct a dataRef from a butler and data identifier""" 19 dataRefList = [ref
for ref
in butler.subset(datasetType, **dataId)]
20 assert len(dataRefList) == 1
25 """Select images by taking everything we're given without further examination 27 This is useful if the examination (e.g., Wcs checking) has been performed 28 previously, and we've been provided a good list. 31 def runDataRef(self, patchRef, coordList, makeDataRefList=True, selectDataList=[]):
33 dataRefList=[s.dataRef
for s
in selectDataList],
35 s.dataRef.dataId,
None)
for s
in selectDataList],
42 """Make self.refList from self.idList 44 It's difficult to make a data reference that merely points to an entire 45 tract: there is no data product solely at the tract level. Instead, we 46 generate a list of data references for patches within the tract. 48 datasetType = namespace.config.coaddName +
"Coadd_calexp" 49 validKeys = set([
"tract",
"filter",
"patch"])
51 def getPatchRefList(tract):
52 return [namespace.butler.dataRef(datasetType=datasetType,
54 filter=dataId[
"filter"],
55 patch=
"%d,%d" % patch.getIndex())
59 for dataId
in self.idList:
61 if key
in (
"tract",
"patch",):
65 raise argparse.ArgumentError(
66 None,
"--id must include " + key)
68 skymap = self.getSkymap(namespace)
71 tractId = dataId[
"tract"]
72 if tractId
not in tractRefs:
73 tractRefs[tractId] = []
75 tractRefs[tractId].append(namespace.butler.dataRef(datasetType=datasetType, tract=tractId,
78 patch=dataId[
'patch']))
80 tractRefs[tractId] += getPatchRefList(skymap[tractId])
82 tractRefs = dict((tract.getId(), tractRefs.get(tract.getId(), []) +
83 getPatchRefList(tract))
for tract
in skymap)
def makeDataRefList(self, namespace)
def runDataRef(self, patchRef, coordList, makeDataRefList=True, selectDataList=[])
def getDataRef(butler, dataId, datasetType="raw")
def getTargetList(parsedCmd, kwargs)