Changeset 36723 for trunk/ippToPsps/jython/batch.py
- Timestamp:
- May 1, 2014, 9:46:08 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/batch.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r36722 r36723 454 454 455 455 filters = ["g","r","i","z","y"] 456 456 count = 0 457 457 for f in filters: 458 skip = 0 458 459 if (f == "g"): 459 fileName = self.gfits.getPath() 460 if self.gstackID > 0: 461 fileName = self.gfits.getPath() 462 else: 463 skip = 1 460 464 if (f == "r"): 461 fileName = self.rfits.getPath() 465 if self.rstackID > 0: 466 fileName = self.rfits.getPath() 467 else: 468 skip = 1 462 469 if (f == "i"): 463 fileName = self.ifits.getPath() 470 if self.istackID > 0: 471 fileName = self.ifits.getPath() 472 else: 473 skip = 1 464 474 if (f == "z"): 465 fileName = self.zfits.getPath() 475 if self.zstackID > 0: 476 fileName = self.zfits.getPath() 477 else: 478 skip = 1 466 479 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: 471 491 tables = stilts.treads(fileName) 472 except:492 except: 473 493 self.logger.errorPair("STILTS could not import from", fileName) 474 494 return False 475 495 476 count = 0477 for table in tables:496 #count = 0 497 for table in tables: 478 498 479 499 # print "import smf table ", table … … 481 501 482 502 if not match: continue 483 self.logger. debugPair("Reading IPP table",table.name)503 self.logger.infoPair("Reading IPP table", f + table.name) 484 504 table = stilts.tpipe(table, cmd='addcol table_index $0') 485 505 … … 506 526 self.logger.exception("Problem writing table '" + f + table.name + "' to the database") 507 527 508 self.logger.infoPair("Done. Imported", "%d tables" % count)509 self.indexIppTables()528 self.logger.infoPair("Done. Imported", "%d tables" % count) 529 self.indexIppTables() 510 530 511 return True531 return True 512 532 513 533 ''' … … 622 642 # for OB, this imports object data from DVO 623 643 if self.batchType == "ST": 644 self.logger.infoPair("did we get here","?") 624 645 if not self.importIppSTTables(): 625 646 self.logger.errorPair("skipping this batch", "could not import ST IPP tables") 626 647 self.ippToPspsDb.updateProcessed(self.batchID, -1) 627 648 raise 649 self.logger.infoPair("we did the ST","yes") 628 650 else: 629 651 # if not ST we do this … … 636 658 self.ippToPspsDb.updateProcessed(self.batchID, -1) 637 659 raise 638 660 self.logger.infoPair("populatePspsTables","ok") 639 661 if not self.populatePspsTables(): 640 662 if self.skipBatch:
Note:
See TracChangeset
for help on using the changeset viewer.
