Skip to content

Commit

Permalink
Allow butlers in subclasses
Browse files Browse the repository at this point in the history
Reference catalog loaders will frequently need butlers.
This allows subclasses to optionally take a butler.
  • Loading branch information
SimonKrughoff committed Jun 1, 2016
1 parent 5b77f9d commit 7623246
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/lsst/meas/algorithms/loadReferenceObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ class LoadReferenceObjectsTask(pipeBase.Task):
ConfigClass = LoadReferenceObjectsConfig
_DefaultName = "LoadReferenceObjects"

def __init__(self, butler=None, *args, **kwargs):
"""!Construct a LoadReferenceObjectsTask
@param[in] butler A daf.persistence.Butler object. This allows subclasses to use the butler to
access reference catalog files using the stack I/O abstraction scheme.
"""
pipeBase.Task.__init__(self, *args, **kwargs)
self.butler = butler

@pipeBase.timeMethod
def loadPixelBox(self, bbox, wcs, filterName=None, calib=None):
"""!Load reference objects that overlap a pixel-based rectangular region
Expand Down

0 comments on commit 7623246

Please sign in to comment.