LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
lsst.coadd.utils.coaddDataIdContainer.CoaddDataIdContainer Class Reference
Inheritance diagram for lsst.coadd.utils.coaddDataIdContainer.CoaddDataIdContainer:
lsst.coadd.utils.coaddDataIdContainer.ExistingCoaddDataIdContainer

Public Member Functions

def getSkymap
 
def makeDataRefList
 

Private Attributes

 _skymap
 

Detailed Description

A version of lsst.pipe.base.DataIdContainer specialized for coaddition.

Required because butler.subset does not support patch and tract

This code was originally in pipe_tasks (coaddBase.py)

Definition at line 28 of file coaddDataIdContainer.py.

Member Function Documentation

def lsst.coadd.utils.coaddDataIdContainer.CoaddDataIdContainer.getSkymap (   self,
  namespace,
  datasetType 
)
Only retrieve skymap if required

Definition at line 35 of file coaddDataIdContainer.py.

35 
36  def getSkymap(self, namespace, datasetType):
37  """Only retrieve skymap if required"""
38  if not hasattr(self, "_skymap"):
39  self._skymap = namespace.butler.get(datasetType + "_skyMap")
40  return self._skymap
def lsst.coadd.utils.coaddDataIdContainer.CoaddDataIdContainer.makeDataRefList (   self,
  namespace 
)
Make self.refList from self.idList

Definition at line 41 of file coaddDataIdContainer.py.

41 
42  def makeDataRefList(self, namespace):
43  """Make self.refList from self.idList
44  """
45  datasetType = namespace.config.coaddName + "Coadd"
46  validKeys = namespace.butler.getKeys(datasetType=datasetType, level=self.level)
47 
48  for dataId in self.idList:
49  for key in validKeys:
50  if key in ("tract", "patch"):
51  # Will deal with these explicitly
52  continue
53  if key not in dataId:
54  raise argparse.ArgumentError(None, "--id must include " + key)
55 
56  # tract and patch are required; iterate over them if not provided
57  if not "tract" in dataId:
58  if "patch" in dataId:
59  raise RuntimeError("'patch' cannot be specified without 'tract'")
60  addList = [dict(tract=tract.getId(), patch="%d,%d" % patch.getIndex(), **dataId)
61  for tract in self.getSkymap(namespace, datasetType) for patch in tract]
62  elif not "patch" in dataId:
63  tract = self.getSkymap(namespace, datasetType)[dataId["tract"]]
64  import pdb
65  pdb.set_trace()
66  addList = [dict(patch="%d,%d" % patch.getIndex(), **dataId) for patch in tract]
67  else:
68  addList = [dataId]
69 
70  self.refList += [namespace.butler.dataRef(datasetType=datasetType, dataId=addId)
71  for addId in addList]

Member Data Documentation

lsst.coadd.utils.coaddDataIdContainer.CoaddDataIdContainer._skymap
private

Definition at line 38 of file coaddDataIdContainer.py.


The documentation for this class was generated from the following file: