Changeset 35057
- Timestamp:
- Jan 25, 2013, 9:01:58 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20121219/ippToPsps/jython
- Files:
-
- 2 edited
-
gpc1db.py (modified) (1 diff)
-
stackbatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/gpc1db.py
r35010 r35057 237 237 else: 238 238 files = glob.glob(path + ".smf") 239 240 241 239 242 240 # XXX EAM : test output -
branches/eam_branches/ipp-20121219/ippToPsps/jython/stackbatch.py
r35056 r35057 2 2 3 3 import os.path 4 import glob 4 5 import sys 5 6 … … 717 718 calling the load data infile '/tmp/name' into table; 718 719 ''' 719 def populateStackDetectionCalib (self):720 def populateStackDetectionCalibInsertUpdate(self): 720 721 self.logger.infoPair("Processing table", "StackDetectionCalib") 721 722 tableName = "StackDetectionCalib" … … 757 758 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease)) 758 759 759 760 760 def populateStackDetectionCalib(self): 761 762 tableName = "StackDetectionCalib" 763 self.logger.infoPair("Processing table", tableName) 764 765 imageID = self.scratchDb.getImageIDFromExternID(self.header['IMAGEID']) 766 self.logger.infoPair("obtained","imageID") 767 768 dumpFile = "/tmp/datadump/genetest.xx.dat" 769 files = glob.glob(dumpFile) 770 if len(files) > 0: 771 os.unlink(dumpFile) 772 773 # insert all detections into table 774 sql = "SELECT \ 775 a.objID, \ 776 a.stackDetectID, \ 777 a.ippObjID, \ 778 a.ippDetectID, \ 779 a.filterID, \ 780 a.surveyID, \ 781 b.ra, \ 782 b.dec_, \ 783 b.raErr, \ 784 b.decErr, \ 785 b.zp, \ 786 b.zpErr, \ 787 b.expTime, \ 788 b.airMass, \ 789 a.dataRelease \ 790 FROM \ 791 StackDetection as a \ 792 JOIN " + self.scratchDb.dvoDetectionTable + " as b \ 793 ON (a.stackDetectID = b.detectID) where b.imageID = " + str(imageID) + \ 794 " INTO OUTFILE '" + dumpFile + "'" 795 print "sql: ", sql 796 self.scratchDb.execute(sql) 797 798 sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName 799 print "sql: ", sql 800 self.scratchDb.execute(sql) 801 self.scratchDb.updateAllRows(tableName, "dataRelease", str(self.config.dataRelease)) 761 802 762 803 '''
Note:
See TracChangeset
for help on using the changeset viewer.
