IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 1, 2014, 9:46:08 PM (12 years ago)
Author:
heather
Message:

first pass of stackbatch stackObject - has objID + basic filter dvo data. woot.

File:
1 edited

Legend:

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

    r36722 r36723  
    454454
    455455      filters = ["g","r","i","z","y"]
    456 
     456      count = 0
    457457      for f in filters:
     458          skip = 0
    458459          if (f == "g"):
    459               fileName = self.gfits.getPath()
     460              if self.gstackID > 0: 
     461                  fileName = self.gfits.getPath()
     462              else:
     463                  skip = 1
    460464          if (f == "r"):
    461               fileName = self.rfits.getPath()
     465              if self.rstackID > 0:
     466                  fileName = self.rfits.getPath()
     467              else:
     468                  skip = 1
    462469          if (f == "i"):
    463               fileName = self.ifits.getPath()
     470              if self.istackID > 0:
     471                  fileName = self.ifits.getPath()
     472              else:
     473                  skip = 1
    464474          if (f == "z"):
    465               fileName = self.zfits.getPath()
     475              if self.zstackID > 0:
     476                  fileName = self.zfits.getPath()
     477              else:
     478                  skip = 1
    466479          if (f == "y"):
    467               fileName = self.yfits.getPath()
    468 
    469 
    470           try:
     480              if self.ystackID > 0:
     481                  fileName = self.yfits.getPath()
     482              else:
     483                  skip = 1
     484
     485          if skip == 1:
     486              self.logger.infoPair("no files for filter" , f)
     487          else:
     488             self.logger.infoPair("using filename:",fileName)
     489         
     490             try:
    471491              tables = stilts.treads(fileName)
    472           except:
     492             except:
    473493              self.logger.errorPair("STILTS could not import from", fileName)
    474494              return False
    475495             
    476           count = 0
    477           for table in tables:
     496             #count = 0
     497             for table in tables:
    478498             
    479499              # print "import smf table ", table
     
    481501             
    482502              if not match: continue
    483               self.logger.debugPair("Reading IPP table", table.name)
     503              self.logger.infoPair("Reading IPP table", f + table.name)
    484504              table = stilts.tpipe(table, cmd='addcol table_index $0')
    485505                 
     
    506526                  self.logger.exception("Problem writing table '" + f + table.name + "' to the database")
    507527                     
    508               self.logger.infoPair("Done. Imported", "%d tables" % count)
    509               self.indexIppTables()
     528      self.logger.infoPair("Done. Imported", "%d tables" % count)
     529      self.indexIppTables()
    510530                     
    511               return True
     531      return True
    512532
    513533    '''
     
    622642        # for OB, this imports object data from DVO
    623643        if self.batchType == "ST":
     644            self.logger.infoPair("did we get here","?") 
    624645            if not self.importIppSTTables():
    625646                self.logger.errorPair("skipping this batch", "could not import ST IPP tables")
    626647                self.ippToPspsDb.updateProcessed(self.batchID, -1)
    627648                raise
     649            self.logger.infoPair("we did the ST","yes")
    628650        else:   
    629651            # if not ST we do this
     
    636658                self.ippToPspsDb.updateProcessed(self.batchID, -1)
    637659                raise
    638 
     660        self.logger.infoPair("populatePspsTables","ok")
    639661        if not self.populatePspsTables():
    640662            if self.skipBatch:
Note: See TracChangeset for help on using the changeset viewer.