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 | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
lsst.pipe.tasks.selectImages.BaseSelectImagesTask Class Reference
Inheritance diagram for lsst.pipe.tasks.selectImages.BaseSelectImagesTask:
lsst.pipe.tasks.selectImages.WcsSelectImagesTask

Public Member Functions

def run
 
def runDataRef
 

Static Public Attributes

 ConfigClass = pexConfig.Config
 

Private Member Functions

def _runArgDictFromDataId
 

Static Private Attributes

string _DefaultName = "selectImages"
 

Detailed Description

Base task for selecting images suitable for coaddition

Definition at line 64 of file selectImages.py.

Member Function Documentation

def lsst.pipe.tasks.selectImages.BaseSelectImagesTask._runArgDictFromDataId (   self,
  dataId 
)
private
Extract keyword arguments for run (other than coordList) from a data ID

@return keyword arguments for run (other than coordList), as a dict

Definition at line 85 of file selectImages.py.

85 
86  def _runArgDictFromDataId(self, dataId):
87  """Extract keyword arguments for run (other than coordList) from a data ID
88 
89  @return keyword arguments for run (other than coordList), as a dict
90  """
91  raise NotImplementedError()
def lsst.pipe.tasks.selectImages.BaseSelectImagesTask.run (   self,
  coordList 
)
Select images suitable for coaddition in a particular region

@param[in] coordList: list of coordinates defining region of interest; if None then select all images
subclasses may add additional keyword arguments, as required

@return a pipeBase Struct containing:
- exposureInfoList: a list of exposure information objects (subclasses of BaseExposureInfo),
    which have at least the following fields:
    - dataId: data ID dictionary
    - coordList: coordinates of the corner of the exposure (list of afwCoord.IcrsCoord)

Definition at line 71 of file selectImages.py.

71 
72  def run(self, coordList):
73  """Select images suitable for coaddition in a particular region
74 
75  @param[in] coordList: list of coordinates defining region of interest; if None then select all images
76  subclasses may add additional keyword arguments, as required
77 
78  @return a pipeBase Struct containing:
79  - exposureInfoList: a list of exposure information objects (subclasses of BaseExposureInfo),
80  which have at least the following fields:
81  - dataId: data ID dictionary
82  - coordList: coordinates of the corner of the exposure (list of afwCoord.IcrsCoord)
83  """
84  raise NotImplementedError()
def lsst.pipe.tasks.selectImages.BaseSelectImagesTask.runDataRef (   self,
  dataRef,
  coordList,
  makeDataRefList = True,
  selectDataList = [] 
)
Run based on a data reference

This delegates to run() and _runArgDictFromDataId() to do the actual
selection. In the event that the selectDataList is non-empty, this will
be used to further restrict the selection, providing the user with
additional control over the selection.

@param[in] dataRef: data reference; must contain any extra keys needed by the subclass
@param[in] coordList: list of coordinates defining region of interest; if None, search the whole sky
@param[in] makeDataRefList: if True, return dataRefList
@param[in] selectDataList: List of SelectStruct with dataRefs to consider for selection
@return a pipeBase Struct containing:
- exposureInfoList: a list of objects derived from ExposureInfo
- dataRefList: a list of data references (None if makeDataRefList False)

Definition at line 92 of file selectImages.py.

92 
93  def runDataRef(self, dataRef, coordList, makeDataRefList=True, selectDataList=[]):
94  """Run based on a data reference
95 
96  This delegates to run() and _runArgDictFromDataId() to do the actual
97  selection. In the event that the selectDataList is non-empty, this will
98  be used to further restrict the selection, providing the user with
99  additional control over the selection.
100 
101  @param[in] dataRef: data reference; must contain any extra keys needed by the subclass
102  @param[in] coordList: list of coordinates defining region of interest; if None, search the whole sky
103  @param[in] makeDataRefList: if True, return dataRefList
104  @param[in] selectDataList: List of SelectStruct with dataRefs to consider for selection
105  @return a pipeBase Struct containing:
106  - exposureInfoList: a list of objects derived from ExposureInfo
107  - dataRefList: a list of data references (None if makeDataRefList False)
108  """
109  runArgDict = self._runArgDictFromDataId(dataRef.dataId)
110  exposureInfoList = self.run(coordList, **runArgDict).exposureInfoList
111 
112  if len(selectDataList) > 0 and len(exposureInfoList) > 0:
113  # Restrict the exposure selection further
114  ccdKeys, ccdValues = _extractKeyValue(exposureInfoList)
115  inKeys, inValues = _extractKeyValue([s.dataRef for s in selectDataList], keys=ccdKeys)
116  inValues = set(inValues)
117  newExposureInfoList = []
118  for info, ccdVal in zip(exposureInfoList, ccdValues):
119  if ccdVal in inValues:
120  newExposureInfoList.append(info)
121  else:
122  self.log.info("De-selecting exposure %s: not in selectDataList" % info.dataId)
123  exposureInfoList = newExposureInfoList
124 
125  if makeDataRefList:
126  butler = dataRef.butlerSubset.butler
127  dataRefList = [butler.dataRef(datasetType = "calexp",
128  dataId = expInfo.dataId,
129  ) for expInfo in exposureInfoList]
130  else:
131  dataRefList = None
132 
133  return pipeBase.Struct(
134  dataRefList = dataRefList,
135  exposureInfoList = exposureInfoList,
136  )
137 

Member Data Documentation

string lsst.pipe.tasks.selectImages.BaseSelectImagesTask._DefaultName = "selectImages"
staticprivate

Definition at line 68 of file selectImages.py.

lsst.pipe.tasks.selectImages.BaseSelectImagesTask.ConfigClass = pexConfig.Config
static

Definition at line 67 of file selectImages.py.


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