Changeset 33688
- Timestamp:
- Apr 3, 2012, 5:22:13 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/objectbatch.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/objectbatch.py
r33687 r33688 96 96 def insertMags(self, cpsTable): 97 97 98 # do this properly with photcode table99 filters = ['g', 'r', 'i', 'z', 'y']98 # list of all filters we are interested in 99 allFilters = ['g', 'r', 'i', 'z', 'y'] 100 100 101 # this loop looks into the DVO Photcodes tables and gets the 'CODE' for each the filters above that are listed 102 filters = [] 103 for filter in allFilters: 104 code = self.scratchDb.getCodeForThisFilter(filter) 105 if code < 0: continue 106 filters.append([code, filter]) 107 108 # the 'code' now defines the order in the cps file that the mags are listed for a given filter 101 109 for filter in filters: 102 110 103 if filter == "g": index = 4104 elif filter == "r": index = 3105 elif filter == "i": index = 2106 elif filter == "z": index = 1107 elif filter == "y": index = 0108 109 111 sql = "UPDATE Object \ 110 JOIN " + cpsTable + " AS cps ON (cps.row = (Object.row*5)-" + str( index) + ") \112 JOIN " + cpsTable + " AS cps ON (cps.row = (Object.row*5)-" + str(filter[0]) + ") \ 111 113 SET \ 112 " + filter + "MeanMag = MAG, \113 " + filter + "MeanMagErr = MAG_ERR"114 " + filter[1] + "MeanMag = MAG, \ 115 " + filter[1] + "MeanMagErr = MAG_ERR" 114 116 115 117 self.scratchDb.execute(sql)
Note:
See TracChangeset
for help on using the changeset viewer.
