Skip to content

Commit

Permalink
Rework ReduceFramesTest following command-line changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulPrice committed Dec 13, 2012
1 parent 6bad1a6 commit cda0873
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions python/hsc/integration/reduceFrames.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,29 @@
import lsst.afw.image.utils as afwIU

class ReduceFramesTest(PbsTest, CcdValidationTest):
def __init__(self, name, camera, visits, time=1200, queue=None, rerun=None, **kwargs):
def __init__(self, name, camera, idDictList, dataIdList, time=1200, rerun=None, **kwargs):
self.camera = camera
self.visits = visits
self.idDictList = idDictList
self.dataIdList = dataIdList
self.rerun = rerun

command = os.path.join(os.environ['HSCPIPE_DIR'], 'bin', 'reduceFrames.py') + " "
command = os.path.join(os.environ['HSCPIPE_DIR'], 'bin', 'reduceFrames.py')
command += " " + camera + " @WORKDIR@ "
command += " --id ".join(" ".join("=".join(kv) for kv in idDict.items()) for idDict in idDictList)
command += " --job=" + name
command += " --instrument=" + camera
command += " --time=%f" % time
if rerun is not None:
command += " --rerun=" + rerun
command += " @PBSARGS@"

super(ReduceFramesTest, self).__init__(name, [command], keywords=["pbs", "process", camera], **kwargs)

def preHook(self, workDir=".", **kwargs):
suprimeDataDir = os.path.split(os.path.abspath(workDir))
if suprimeDataDir[-1] in ("SUPA", "HSC"):
# hsc.pipe.base.camera.getButler will add this directory on
suprimeDataDir = suprimeDataDir[:-1]
os.environ['SUPRIME_DATA_DIR'] = os.path.join(*suprimeDataDir)
# def preHook(self, workDir=".", **kwargs):
# suprimeDataDir = os.path.split(os.path.abspath(workDir))
# if suprimeDataDir[-1] in ("SUPA", "HSC"):
# # hsc.pipe.base.camera.getButler will add this directory on
# suprimeDataDir = suprimeDataDir[:-1]
# os.environ['SUPRIME_DATA_DIR'] = os.path.join(*suprimeDataDir)

def validate(self, workDir=".", **kwargs):
self.validatePbs()
Expand All @@ -37,10 +39,8 @@ def validate(self, workDir=".", **kwargs):
root=os.path.join(workDir, cameraInfo.addDir))
numCcds = hscCamera.getNumCcds(self.camera)

for visit in self.visits:
for ccd in range(numCcds):
dataId = {'visit': visit, 'ccd': ccd}
self.validateCcd(butler, dataId)
for dataId in self.dataIdList:
self.validateCcd(butler, dataId)

def postHook(self, **kwargs):
afwIU.resetFilters() # So other cameras may be run
afwIU.resetFilters() # So other cameras may be run

0 comments on commit cda0873

Please sign in to comment.