Skip to content

Commit

Permalink
Fix flake8 warnings in coaddInputRecorder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
r-owen committed Oct 14, 2016
1 parent 15abcdb commit fd4c46d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/lsst/pipe/tasks/coaddInputRecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

__all__ = ["CoaddInputRecorderTask"]


class CoaddInputRecorderConfig(pexConfig.Config):
"""Config for CoaddInputRecorderTask
Expand Down Expand Up @@ -57,6 +58,7 @@ class CoaddInputRecorderConfig(pexConfig.Config):
" (This is necessary for easy construction of CoaddPsf, but otherwise duplicate information.)")
)


class CoaddTempExpInputRecorder(object):
"""A helper class for CoaddInputRecorderTask, managing the CoaddInputs object for that a single
CoaddTempExp. This will contain single 'visit' record for the CoaddTempExp and a number of 'ccd'
Expand Down Expand Up @@ -102,13 +104,13 @@ def addCalExp(self, calExp, ccdId, nGoodPix):
record.setI(self.task.ccdCcdKey, calExp.getDetector().getId())
except:
self.task.log.warn("Error getting detector serial number in visit %d; using -1"
% self.visitRecord.getId())
% self.visitRecord.getId())
record.setI(self.task.ccdCcdKey, -1)
record.setI(self.task.ccdGoodPixKey, nGoodPix)
if calExp is not None:
self._setExposureInfoInRecord(exposure=calExp, record=record)
if self.task.config.saveCcdWeights:
record.setD(self.task.ccdWeightKey, 1.0) # No weighting or overlap when warping
record.setD(self.task.ccdWeightKey, 1.0) # No weighting or overlap when warping

def finish(self, coaddTempExp, nGoodPix=None):
"""Finish creating the CoaddInputs for a CoaddTempExp.
Expand Down Expand Up @@ -145,6 +147,7 @@ def _setExposureInfoInRecord(self, exposure, record):
record.setVisitInfo(info.getVisitInfo())
record.setBBox(exposure.getBBox())


class CoaddInputRecorderTask(pipeBase.Task):
"""Subtask that handles filling a CoaddInputs object for a coadd exposure, tracking the CCDs and
visits that went into a coadd.
Expand All @@ -156,7 +159,7 @@ class CoaddInputRecorderTask(pipeBase.Task):
ConfigClass = CoaddInputRecorderConfig

def __init__(self, *args, **kwargs):
pipeBase.Task.__init__(self, *args, **kwargs)
pipeBase.Task.__init__(self, *args, **kwargs)
self.visitSchema = afwTable.ExposureTable.makeMinimalSchema()
if self.config.saveVisitGoodPix:
self.visitGoodPixKey = self.visitSchema.addField("goodpix", type=int,
Expand Down Expand Up @@ -202,7 +205,7 @@ def addVisitToCoadd(self, coaddInputs, coaddTempExp, weight):
"(found %d). CoaddInputs for this visit will not be saved."
% len(tempExpInputs.visits))
return None
inputVisitRecord = tempExpInputs.visits[0];
inputVisitRecord = tempExpInputs.visits[0]
outputVisitRecord = coaddInputs.visits.addNew()
outputVisitRecord.assign(inputVisitRecord)
outputVisitRecord.setD(self.visitWeightKey, weight)
Expand Down

0 comments on commit fd4c46d

Please sign in to comment.