IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32589 for trunk/ippToPsps


Ignore:
Timestamp:
Oct 28, 2011, 11:40:06 AM (15 years ago)
Author:
rhenders
Message:

now exiting cleanly if no FITS file is found for non-IN batches; removed some commented-out code

File:
1 edited

Legend:

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

    r32467 r32589  
    5454        self.logger.debug("Batch class constructor")
    5555
    56         # check FITS file is ok - TODO could be neater
     56        # check FITS file is ok
    5757        if self.fits:
    5858            self.header = self.fits.getPrimaryHeader()
     59
     60            # now check that the fits header is readable
    5961            if not self.header: return
     62
     63        # if no fits file, and this is not an IN batch, then get out of here
     64        else:
     65           if batchType != "IN": return
    6066
    6167        # set up class variables
     
    9197        # create datastore object
    9298        self.datastore = Datastore(self.logger, self.doc, self.ippToPspsDb)
    93 
    94         # create a new batch
    95         #self.batchID = self.ippToPspsDb.createNewBatch(
    96         #       self.batchType,
    97         #        self.id,
    98         #        self.survey,
    99         #        self.dvoGpc1Label,
    100         #        self.datastore.product)
    10199
    102100        # get local storage location from config
     
    265263        else: root.attrib['maxObjId'] = str(self.maxObjID)
    266264
    267         # get md5sum
    268         #p = Popen("md5sum " + self.outputFitsPath, shell=True, stdout=PIPE)
    269         #p.wait()
    270         #out = p.stdout.read()
    271         #md5sum = out[0:out.rfind(" ")]
    272 
    273         # get file size
    274         #fileSize = os.path.getsize(self.outputFitsPath)
    275 
    276265        # file information
    277266        child = Element('file')
    278267        root.append(child)
    279268        child.attrib['name'] = self.outputFitsFile
    280         #child.attrib['bytes'] = str(fileSize)
    281         #child.attrib['md5'] = md5sum
    282269
    283270        # now create doc and write to file
Note: See TracChangeset for help on using the changeset viewer.