Changeset 35077
- Timestamp:
- Jan 31, 2013, 5:47:48 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20121219/ippToPsps
- Files:
-
- 10 edited
-
config/ippToPspsDbSchema.sql (modified) (1 diff)
-
doc/upgrade.txt (modified) (2 diffs)
-
jython/dvo.py (modified) (7 diffs)
-
jython/dvodetections.py (modified) (1 diff)
-
jython/dvoobjects.py (modified) (1 diff)
-
jython/ipptopspsdb.py (modified) (2 diffs)
-
jython/loader.py (modified) (3 diffs)
-
jython/objectbatch.py (modified) (1 diff)
-
jython/queue.py (modified) (2 diffs)
-
test/fulltest.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/config/ippToPspsDbSchema.sql
r35076 r35077 62 62 `dec_center` float default NULL, 63 63 `box_side` float default NULL, 64 `ingested` tinyint(1) default '0', 64 65 PRIMARY KEY (`id`), 65 66 KEY `fk_skychunk` (`skychunk`), -
branches/eam_branches/ipp-20121219/ippToPsps/doc/upgrade.txt
r35076 r35077 1 1 2 2012.01.29 2 2013.0 3 4 2013.01.29 3 5 4 6 I'm trying to re-work the operational model. First, make sure we have correct names for concepts: … … 30 32 31 33 32 201 2.01.2734 2013.01.27 33 35 34 36 remaining issues: -
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py
r35076 r35077 33 33 34 34 ''' 35 def __init__(self, logger, config, skychunk, scratchDbName=None):35 def __init__(self, logger, config, skychunk, ippToPspsDb, scratchDbName=None): 36 36 37 37 # set up logging … … 39 39 self.config = config 40 40 self.skychunk = skychunk 41 self.ippToPspsDb = ippToPspsDb 41 42 42 43 # set up empty lists … … 47 48 self.regionsIngestedButOutOfDate = [] 48 49 49 # XXX use Stilts for ingest in certain cases or not?50 self.useStilts = 051 52 50 # connect to the specified scratch database, if a name is given, otherwise use the first version 53 51 try: … … 55 53 except: raise 56 54 55 # we have (still) 3 modes of ingest from dvo cpt/cps/cpm files 56 # 1) dvograbber (useFullTables == FALSE), 57 # 2) jython/stilts (useStilts == TRUE, useFullTables == TRUE) 58 # 3) dvopsps (useStilts == FALSE, useFullTables == TRUE) 59 # my goal (EAM, 2013/01/31) is to migrate to only dvopsps 60 61 self.useStilts = 0 57 62 self.scratchDb.setUseFullTables(True) 58 63 … … 569 574 includes purging detections outside sky area 570 575 ''' 571 def nativeIngestDetections(self, raCenter, decCenter, boxSize): 572 573 # XXX put the skychunk below in a separate method 576 def nativeIngestDetections(self, boxId, raCenter, decCenter, boxSize): 577 578 # XXX put the chunk below in a separate method 579 # blow away existing dvoDetection table 580 581 # clear the 'ingested' field for all boxes 582 self.ippToPspsDb.clearIngestedBoxes() 574 583 575 584 # drop detections table … … 599 608 self.loadImages() 600 609 601 # XXX blow away existing dvoDetection table?602 603 610 # dvopsps -D catdir CATDIR -region .... -dbhost xx -dbname xx -dbuser xx -dbpass xx 604 611 halfSize = boxSize / 2.0 … … 625 632 p.wait() 626 633 634 self.ippToPspsDb.setIngestedBox(boxId) 635 627 636 # update lists after attempted sync 628 637 # self.printSummary() -
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvodetections.py
r35076 r35077 20 20 Constructor 21 21 ''' 22 def __init__(self, logger, config, skychunk, scratchDbName):22 def __init__(self, logger, config, skychunk, ippToPspsDb, scratchDbName): 23 23 24 super(DvoDetections, self).__init__(logger, config, skychunk, scratchDbName)24 super(DvoDetections, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDbName) 25 25 26 26 # declare DVO file types of interest -
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvoobjects.py
r35076 r35077 20 20 Constructor 21 21 ''' 22 def __init__(self, logger, config, skychunk, scratchDbName=None):22 def __init__(self, logger, config, skychunk, ippToPspsDb, scratchDbName=None): 23 23 24 super(DvoObjects, self).__init__(logger, config, skychunk, scratchDbName)24 super(DvoObjects, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDbName) 25 25 26 26 # declare DVO file types of interest -
branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopspsdb.py
r35076 r35077 894 894 if field == 'timestamp': continue 895 895 if field == 'name': continue 896 if field == 'ingested_det': continue 897 if field == 'ingested_obj': continue 896 898 897 899 # get current value for this field, if any … … 1075 1077 1076 1078 ''' 1079 Inserts new box into box table. If it already exisits, it returns existing box id 1080 ''' 1081 def isBoxIngested(self, id): 1082 1083 # set the field 'ingested' to 1 for this box 1084 sql = "select ingested from box where id = " + str(id) 1085 try: 1086 rs = self.executeQuery(sql) 1087 if not rs.next(): 1088 print "no matching boxes for ", str(id) 1089 raise 1090 status = rs.getInt(1) 1091 except: 1092 print "failed to set box ", str(id), "as ingested" 1093 raise 1094 1095 return status 1096 ''' 1097 Inserts new box into box table. If it already exisits, it returns existing box id 1098 ''' 1099 def setIngestedBox(self, id): 1100 1101 # set the field 'ingested' to 1 for this box 1102 sql = "update box set ingested = 1 where id = " + str(id) 1103 try: 1104 self.execute(sql) 1105 except: 1106 print "failed to set box ", str(id), "as ingested" 1107 raise 1108 1109 ''' 1110 Inserts new box into box table. If it already exisits, it returns existing box id 1111 ''' 1112 def clearIngestedBoxes(self): 1113 1114 # set the field 'ingested' to 1 for this box 1115 sql = "update box set ingested = 0" 1116 try: 1117 self.execute(sql) 1118 except: 1119 print "failed to clear boxes as ingested" 1120 raise 1121 1122 ''' 1077 1123 Inserts new box ids into the pending table 1078 1124 ''' -
branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py
r35076 r35077 97 97 except: return ret 98 98 99 self.dvoDetections = DvoDetections(self.logger, self.config, self.skychunk, self. scratchDb.dbName)99 self.dvoDetections = DvoDetections(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb.dbName) 100 100 101 101 return ret … … 197 197 # need to work out a good boundary / region strategy in coordination with 198 198 # impact of mysql insertion 199 self.dvoDetections.nativeIngestDetections(boxDim['RA'], boxDim['DEC'], boxSizeSansBorder) 199 if not self.ippToPspsDb.isBoxIngested(boxId): 200 self.dvoDetections.nativeIngestDetections(boxId, boxDim['RA'], boxDim['DEC'], boxSizeSansBorder) 201 200 202 useFullTables = 1 201 203 … … 215 217 break 216 218 self.logger.infoPair("processed","ok") 219 217 220 if abort or not self.checkClientStatus(): abort = True 218 221 elif numAttempts > 1 and not self.waitForPollTime(): break -
branches/eam_branches/ipp-20121219/ippToPsps/jython/objectbatch.py
r35076 r35077 54 54 55 55 try: 56 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self. scratchDb.dbName)56 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb.dbName) 57 57 except: 58 58 self.logger.errorPair("Unable to create instance of", "DvoObjects") -
branches/eam_branches/ipp-20121219/ippToPsps/jython/queue.py
r35076 r35077 32 32 33 33 try: 34 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk )34 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb) 35 35 except: 36 36 self.exitProgram("Unable to create instance of DvoObject") … … 64 64 65 65 # for object batches, get full list of stuff from Dvo 66 # XXX : need to fix 'dvo.setSkyArea' or this may not return the full list for a parallel dvo 66 67 if batchType == "OB": 67 68 self.dvoObjects.setSkyArea( -
branches/eam_branches/ipp-20121219/ippToPsps/test/fulltest.sh
r35076 r35077 29 29 set mkdummy = 0 30 30 set initscratch = 0 31 set camqueue = 031 set camqueue = 1 32 32 set initbatch = 0 33 set cambatch = 034 set stackqueue = 135 set stackbatch = 136 set objectqueue = 137 set objectbatch = 133 set cambatch = 1 34 set stackqueue = 0 35 set stackbatch = 0 36 set objectqueue = 0 37 set objectbatch = 0 38 38 39 39 set OUTDIR = "testdata"
Note:
See TracChangeset
for help on using the changeset viewer.
