- Timestamp:
- Oct 21, 2016, 1:09:00 PM (10 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 7 edited
-
config/changes.txt (modified) (1 diff)
-
config/ippToPspsDbSchema.sql (modified) (1 diff)
-
config/settings.xml (modified) (1 diff)
-
jython/Makefile.am (modified) (2 diffs)
-
jython/gaiaobjectbatch.py (modified) (11 diffs)
-
jython/ipptopspsdb.py (modified) (1 diff)
-
jython/loader.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/config/changes.txt
r36201 r39786 9 9 10 10 -- not yet alter table batch add column smf_version varchar(16) after comment; 11 12 alter table skychunk add column queue_FG tinyint after queue_FO; 13 alter table skychunk add column queue_GO tinyint after queue_FG; 14 15 alter table skychunk change column queue_FG queue_FG tinyint(1); 16 alter table skychunk change column queue_GO queue_GO tinyint(1); 17 alter table skychunk change column queue_GO queue_GO tinyint(1) default 0; 18 alter table skychunk change column queue_FO queue_FO tinyint(1) default 0; 19 alter table skychunk change column queue_FG queue_FG tinyint(1) default 0; -
trunk/ippToPsps/config/ippToPspsDbSchema.sql
r39785 r39786 219 219 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 220 220 SET character_set_client = @saved_cs_client; 221 -- 222 -- Table structure for table `forcedgalobject` 223 -- 224 DROP TABLE IF EXISTS `forcedgalobject`; 225 SET @saved_cs_client = @@character_set_client; 226 SET character_set_client = utf8; 227 CREATE TABLE `forcedgalobject` ( 228 `batch_id` bigint(20) unsigned NOT NULL, 229 `region` varchar(50) default NULL, 230 KEY `batch_id` (`batch_id`), 231 CONSTRAINT `forcedgalobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`) 232 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 233 SET character_set_client = @saved_cs_client; 234 235 236 237 -- 238 -- Table structure for table `gaiaobject` 239 -- 240 DROP TABLE IF EXISTS `gaiaobject`; 241 SET @saved_cs_client = @@character_set_client; 242 SET character_set_client = utf8; 243 CREATE TABLE `gaiaobject` ( 244 `batch_id` bigint(20) unsigned NOT NULL, 245 `region` varchar(50) default NULL, 246 KEY `batch_id` (`batch_id`), 247 CONSTRAINT `gaiaobject_fk_1` FOREIGN KEY (`batch_id`) REFERENCES `batch` (`batch_id`) 248 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 249 SET character_set_client = @saved_cs_client; 250 221 251 222 252 -- -
trunk/ippToPsps/config/settings.xml
r39644 r39786 819 819 <!-- ippToPsps Db section (REAL version) --> 820 820 <ipptopspsdatabase> 821 <name>ipptopsps 2</name>821 <name>ipptopsps3</name> 822 822 <host>ipp006</host> 823 823 <user>dvo</user> -
trunk/ippToPsps/jython/Makefile.am
r39007 r39786 19 19 dvoforcedgalaxy.py \ 20 20 dvoobjects.py \ 21 dvogaiaobjects.py \ 21 22 dvo.py \ 22 23 dxlayer.py \ … … 25 26 forcedwarpbatch.py \ 26 27 forcedgalaxybatch.py \ 28 gaiaobjectbatch.py \ 27 29 gpc1db.py \ 28 30 initbatch.py \ -
trunk/ippToPsps/jython/gaiaobjectbatch.py
r39785 r39786 14 14 from ipptopspsdb import IppToPspsDb 15 15 from scratchdb import ScratchDb 16 from dvo objects import DvoObjects16 from dvogaiaobjects import DvoGaiaObjects 17 17 from sqlUtility import sqlUtility 18 18 … … 49 49 dvoID, 50 50 batchID, 51 " OB",51 "GO", 52 52 None) 53 53 … … 84 84 ''' 85 85 def alterPspsTables(self): 86 87 self.scratchDb.execute("ALTER TABLE GaiaFrameCoordinate CHANGE dec_ `dec` double") 86 88 87 89 return True … … 119 121 cpsTableName = self.scratchDb.getDbFriendlyTableName(self.region + ".cps") 120 122 121 if False: 123 #if False: 124 # self. 122 125 # XXX EAM 20140724 : this is probably wrong : flux measurements can be 0.0 or negative: please review 123 126 self.logger.info("Populating GaiaFrameCoordinate") … … 134 137 sqlLine.group("batchID", "'" + str(self.batchID) + "'") 135 138 sqlLine.group("ra", "RA_MEAN") 136 sqlLine.group(" dec", "DEC_MEAN")139 sqlLine.group("`dec`", "DEC_MEAN") 137 140 sqlLine.group("raErr", "RA_ERR") 138 141 sqlLine.group("decErr", "DEC_ERR") 139 142 sqlLine.group("gaiaFlag", "FLAGS") 140 143 sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName) 141 144 … … 179 182 #count out of range 180 183 181 sql = "SELECT count(*) FROM gaiaFrameCoordinate where \182 gaiaFrameCoordinate.dec> " + str(decMax) + " \183 or gaiaFrameCoordinate.dec< " + str(decMin) + " \184 or gaiaFrameCoordinate.ra > " + str(raMax) + " \185 or gaiaFrameCoordinate.ra < " + str(raMin)184 sql = "SELECT count(*) FROM GaiaFrameCoordinate where \ 185 GaiaFrameCoordinate.`dec` > " + str(decMax) + " \ 186 or GaiaFrameCoordinate.`dec` < " + str(decMin) + " \ 187 or GaiaFrameCoordinate.ra > " + str(raMax) + " \ 188 or GaiaFrameCoordinate.ra < " + str(raMin) 186 189 187 190 rs = self.scratchDb.executeQuery(sql) … … 193 196 194 197 195 sql = "DELETE FROM gaiaFrameCoordinate where \196 gaiaFrameCoordinate.dec> (" + str(decMax) + " + .0033) or \197 gaiaFrameCoordinate.dec< (" + str(decMin) + " - .0033) or \198 gaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \199 gaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)"198 sql = "DELETE FROM GaiaFrameCoordinate where \ 199 GaiaFrameCoordinate.`dec` > (" + str(decMax) + " + .0033) or \ 200 GaiaFrameCoordinate.`dec` < (" + str(decMin) + " - .0033) or \ 201 GaiaFrameCoordinate.ra > (" + str(raMax) + " + .0033) or \ 202 GaiaFrameCoordinate.ra < (" + str(raMin) + " - .0033)" 200 203 self.logger.infoPair("Deleting", str(nToDelete) + " objects outside of ra/dec range") 201 204 … … 203 206 self.scratchDb.execute(sql) 204 207 except: 205 self.logger.errorPair("Couldn't cull outsiders from gaiaFrameCoordinate table", sql)208 self.logger.errorPair("Couldn't cull outsiders from GaiaFrameCoordinate table", sql) 206 209 raise 207 210 … … 210 213 self.logger.infoPair("updatePspsUniqueIDs","end") 211 214 212 self.logger.infoPair("Dropping row column from", " gaiaFrameCoordinate table")213 self.scratchDb.dropColumn(" gaiaFrameCoordinate", "row")214 self.logger.infoPair("Dropped row column", " gaiaFrameCoordinate")215 216 self.setMinMaxObjID([" gaiaFrameCoordinate"])215 self.logger.infoPair("Dropping row column from", "GaiaFrameCoordinate table") 216 self.scratchDb.dropColumn("GaiaFrameCoordinate", "row") 217 self.logger.infoPair("Dropped row column", "GaiaFrameCoordinate") 218 219 self.setMinMaxObjID(["GaiaFrameCoordinate"]) 217 220 218 221 return True … … 234 237 235 238 ### force objID uniqueness on *** ObjectThin *** 236 self.logger.infoPair("Forcing uniqueness on", "objID in gaiaFrameCoordinate table")237 rowCountBefore = self.scratchDb.getRowCount(" gaiaFrameCoordinate")239 self.logger.infoPair("Forcing uniqueness on", "objID in GaiaFrameCoordinate table") 240 rowCountBefore = self.scratchDb.getRowCount("GaiaFrameCoordinate") 238 241 239 242 # XXX EAM : note that in mysql versions later than 5.1, this fails … … 246 249 self.scratchDb.execute("set session old_alter_table=1") 247 250 248 self.scratchDb.execute("ALTER IGNORE TABLE gaiaFrameCoordinate ADD UNIQUE INDEX(objID)")251 self.scratchDb.execute("ALTER IGNORE TABLE GaiaFrameCoordinate ADD UNIQUE INDEX(objID)") 249 252 if self.scratchDb.version > 5.1: 250 253 self.scratchDb.execute("set session old_alter_table=0") 251 254 252 rowCountAfter = self.scratchDb.getRowCount(" gaiaFrameCoordinate")255 rowCountAfter = self.scratchDb.getRowCount("GaiaFrameCoordinate") 253 256 self.logger.infoPair("Number of duplicated objIDs removed", "%d out of %d" % ((rowCountBefore - rowCountAfter), rowCountBefore)) 254 257 -
trunk/ippToPsps/jython/ipptopspsdb.py
r39785 r39786 828 828 self.execute(sql) 829 829 830 '''830 ''' 831 831 Inserts some gaiaobject metadata for this batch ID 832 832 ''' -
trunk/ippToPsps/jython/loader.py
r39785 r39786 30 30 from forcedobjectbatch import ForcedObjectBatch 31 31 from forcedgalaxybatch import ForcedGalaxyBatch 32 from gaiaobjectbatch import GaiaObjectBatch 33 32 34 # 33 35 #
Note:
See TracChangeset
for help on using the changeset viewer.
