IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32211 for trunk/ippToPsps


Ignore:
Timestamp:
Aug 29, 2011, 9:30:53 AM (15 years ago)
Author:
rhenders
Message:

checking FITS file is ok before proceeding; added some log messages when a batch fails;

File:
1 edited

Legend:

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

    r32194 r32211  
    4747        self.doc = doc
    4848        self.fits = fits
    49         if self.fits: self.header = self.fits.getPrimaryHeader()
    5049
    5150        # set up logging
     
    5352        self.logger.infoSeparator()
    5453        self.logger.debug("Batch class constructor")
     54
     55        # check FITS file is ok - TODO could be neater
     56        if self.fits:
     57            self.header = self.fits.getPrimaryHeader()
     58            if not self.header: return
    5559
    5660        # set up class variables
     
    315319    @staticmethod
    316320    def publishToDatastore(datastore, ippToPspsDb, batchID, batchName, subDir, tarballFile):
     321
    317322        if datastore.publish(batchName, subDir, tarballFile, "tgz"):
    318323            ippToPspsDb.updateLoadedToDatastore(batchID, 1)
     
    518523        self.createEmptyPspsTables()
    519524        self.importIppTables()
    520         if self.populatePspsTables():
    521             if self.exportPspsTablesToFits():
     525        if not self.populatePspsTables():
     526            self.logger.errorPair("Aborting this batch", "unable to populate PSPS tables")
     527        else:
     528            if not self.exportPspsTablesToFits():
     529                self.logger.errorPair("Aborting this batch", "unable to export tables to FITS file")
     530            else:
    522531                self.writeBatchManifest()
    523532                if int(self.doc.find("options/publishToDatastore").text): self.tarZipAndpublishToDatastore()
Note: See TracChangeset for help on using the changeset viewer.