Changeset 35060
- Timestamp:
- Jan 26, 2013, 5:47:08 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20121219/ippToPsps/jython
- Files:
-
- 2 edited
-
detectionbatch.py (modified) (3 diffs)
-
stackbatch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py
r35044 r35060 3 3 import os.path 4 4 import sys 5 import glob 5 6 import time 6 7 import stilts 8 7 9 from java.lang import * 8 10 from java.sql import * … … 529 531 Populates the DetectionCalib table for this OTA 530 532 ''' 531 def populateDetectionCalibTable (self, ota):533 def populateDetectionCalibTableUpdateInsert(self, ota): 532 534 533 535 tableName = "DetectionCalib_" + ota … … 570 572 self.scratchDb.execute(sql) 571 573 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease)) 574 575 ''' 576 Populates the DetectionCalib table for this OTA 577 ''' 578 def populateDetectionCalibTable(self, ota): 579 580 # target table name: 581 tableName = "DetectionCalib_" + ota 582 # drop then re-create table 583 self.scratchDb.dropTable(tableName) 584 sql = "CREATE TABLE " + tableName + " LIKE DetectionCalib" 585 try: self.scratchDb.execute(sql) 586 except: pass 587 588 dumpFile = "/tmp/datadump/genetest.xx.dat" 589 files = glob.glob(dumpFile) 590 if len(files) > 0: 591 os.unlink(dumpFile) 592 593 # insert all detections into table 594 sql = "SELECT \ 595 a.objID, \ 596 a.detectID, \ 597 a.ippObjID, \ 598 a.ippDetectID, \ 599 a.filterID, \ 600 a.surveyID, \ 601 b.ra, \ 602 b.dec_, \ 603 b.raErr, \ 604 b.decErr, \ 605 b.zp, \ 606 b.zpErr, \ 607 b.expTime, \ 608 b.airMass, \ 609 " + str(self.config.dataRelease) + " \ 610 FROM \ 611 Detection_" + ota + " as a \ 612 JOIN " + self.scratchDb.dvoDetectionTable + " as b \ 613 ON (a.objID = b.objID AND a.detectID = b.detectID) \ 614 INTO OUTFILE '" + dumpFile + "'" 615 print "sql: ", sql 616 self.scratchDb.execute(sql) 617 618 sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName 619 print "sql: ", sql 620 self.scratchDb.execute(sql) 572 621 573 622 ''' -
branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py
r35057 r35060 787 787 b.expTime, \ 788 788 b.airMass, \ 789 a.dataRelease\789 " + str(self.config.dataRelease) + " \ 790 790 FROM \ 791 791 StackDetection as a \ … … 799 799 print "sql: ", sql 800 800 self.scratchDb.execute(sql) 801 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease)) 801 802 ## XXX write this with the select/insert 803 # self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease)) 802 804 803 805 '''
Note:
See TracChangeset
for help on using the changeset viewer.
