IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2011, 4:25:39 PM (15 years ago)
Author:
rhenders
Message:

now using config file values to determine whether we publish to datastore, report NULLS etc; fixed bug in findAndReadFITSHeader() where subsequent hdr extesnions were not being read after one fails

File:
1 edited

Legend:

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

    r31469 r31720  
    7373
    7474        # open config
    75         doc = ElementTree(file="config.xml")
     75        self.doc = ElementTree(file="config.xml")
    7676
    7777        if self.survey != "":
     
    7979   
    8080            # get dvo info from config
    81             dvoName = doc.find("dvo_" + self.survey + "/name").text
    82             self.dvoLocation = doc.find("dvo_" + self.survey + "/location").text
     81            dvoName = self.doc.find("dvo_" + self.survey + "/name").text
     82            self.dvoLocation = self.doc.find("dvo_" + self.survey + "/location").text
    8383        else:
    8484            dvoName = ""
    8585            self.dvoLocation = ""
    8686            self.surveyID = -1;
    87          
     87       
     88        # get some options from the config
     89        self.dataRelease = self.doc.find("metadata/dataRelease").text
     90
    8891        # get datastore info from config
    8992        self.datastore = Datastore(self.logger)
     
    98101        # get local storage location from config
    99102        self.batchName = "B%08d" % self.batchID
    100         self.subDir = doc.find("localOutPath").text + "/" + self.getPspsBatchType() + "/" + dvoName
     103        self.subDir = self.doc.find("localOutPath").text + "/" + self.getPspsBatchType() + "/" + dvoName
    101104        self.localOutPath = self.subDir + "/" + self.batchName
    102105        if not os.path.exists(self.localOutPath): os.makedirs(self.localOutPath)
     
    156159
    157160        found = False
    158        
     161       
     162        origIndex = file.tell()
    159163        while True:
    160164           
     
    175179            file.seek(index + 2880, 0)
    176180           
    177         if found != True:
     181        if found != True:
     182
     183            file.seek(origIndex, 0)
    178184            self.logger.error("...could not read header in extension '" + name + "'")
    179185            return
     
    238244    def createTarball(self):
    239245     
     246        if self.doc.find("options/createTarball").text == "false": return
     247
    240248        # set up filenams and paths
    241249        tarFile = self.batchName + ".tar"
     
    263271    '''
    264272    def publishToDatastore(self):
     273
     274        if self.doc.find("options/publishToDatastore").text == "false": return
    265275
    266276        if self.datastore.publish(self.batchName, self.subDir, self.tarballFile, "tgz"):
     
    462472    def reportNullsInAllPspsTables(self, showPartials):
    463473
     474        if self.doc.find("options/reportNulls").text == "false": return
     475
    464476        for table in self.pspsTables:
    465477            self.scratchDb.reportNulls(table.name, showPartials)
     
    515527
    516528        self.createEmptyPspsTables()
    517         self.importIppTables()
     529        #self.importIppTables()
    518530        if self.populatePspsTables():
    519531            if self.exportPspsTablesToFits():
     
    521533                self.createTarball()
    522534                self.publishToDatastore()
    523                 #self.reportNullsInAllPspsTables(False)
     535                self.reportNullsInAllPspsTables(False)
    524536                #sys.exit()
    525537        self.logger.info("Finished.")
Note: See TracChangeset for help on using the changeset viewer.