IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38871


Ignore:
Timestamp:
Oct 17, 2015, 6:00:00 AM (11 years ago)
Author:
eugene
Message:

send dvopsps output to /tmp/files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/dvo.py

    r38837 r38871  
    99import logging
    1010import glob
     11import tempfile
    1112from subprocess import call, PIPE, Popen
    1213
     
    632633            use_trange = 1
    633634
    634 
    635         # TODO path to DVO prog hardcoded temporarily
    636635        cmd = "dvopsps detections"
    637636        cmd += " -dbhost " + self.scratchDb.dbHost
     
    666665        for batchType in self.skychunk.batchTypes:
    667666            self.logger.infoPair("batchType", batchType)
    668             if batchType == "ST":
    669                 useST = 1
    670             if batchType == "P2":
    671                 useP2 = 1
    672             if batchType == "DF":
    673                 useDF = 1
    674             if batchType == "FW":
    675                 useFW = 1
    676                
     667            if batchType == "ST": useST = 1
     668            if batchType == "P2": useP2 = 1
     669            if batchType == "DF": useDF = 1
     670            if batchType == "FW": useFW = 1
    677671               
    678672        if (useP2 == 0 and useST == 1):
     
    704698            else:
    705699                print "need photcode for warp for gpc1 camera, default is no selection, should work, could be slow"
    706 
    707 
    708700               
     701        (dvoStdoutFile, dvoStdoutName) = tempfile.mkstemp(prefix="dvopsps.stdout.", dir="/tmp")
     702        (dvoStderrFile, dvoStderrName) = tempfile.mkstemp(prefix="dvopsps.stderr.", dir="/tmp")
     703
    709704        self.logger.infoPair("Running dvopsps", cmd)
    710         p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
     705        self.logger.infoPair("Stdout to ", dvoStdoutName)
     706        self.logger.infoPair("Stderr to ", dvoStderrName)
     707        p = Popen(cmd, shell=True, stdout=dvoStdoutFile, stderr=dvoStderrFile)
    711708        p.wait()
    712709        if p.returncode != 0:
    713710            self.logger.errorPair("dvopsps failed on ", self.scratchDb.dvoDetectionTable)
    714711            raise
     712
     713        os.close(dvoStdoutFile)
     714        os.close(dvoStderrFile)
    715715
    716716        ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
Note: See TracChangeset for help on using the changeset viewer.