Changeset 33184 for trunk/ippToPsps/jython/dvo.py
- Timestamp:
- Jan 31, 2012, 4:22:51 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/dvo.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/dvo.py
r33183 r33184 46 46 self.scratchDb = ScratchDb(logger, self.doc, 1) 47 47 48 # decide if we are using the right DVO 49 self.correctDvo = self.scratchDb.isThisDvoCurrentlyIngested(self.dvoLocation) 50 51 # using correct DVO, so now get up-to-date versions of Images and SkyTable tables 52 self.updateMetaTables() 48 # or decide if we are using the right DVO 49 self.correctDvo = self.scratchDb.isCorrectDvo(self.dvoLocation) 53 50 54 51 ''' … … 60 57 61 58 ''' 62 Updates two main meta tables, Images and SkyTable63 '''64 def updateMetaTables(self):65 66 self.loadImages()67 self.loadSkyTable()68 69 '''70 59 Check we are importing the DVO currenly ingested 71 60 ''' … … 77 66 ''' 78 67 def resetDetections(self): 68 79 69 self.logger.infoPair("Resetting", "just detections") 80 70 self.scratchDb.resetOnlyDetectionDvoTables() … … 173 163 174 164 ''' 165 Gets a bunch of region files from DVO for a RA/Dec box centered with these coords and with this side length PLUS a border 166 ''' 167 def getRegionsInThisBoxWithBorder(self, regionsToIngest, regionsToPurge, ra=180., dec=0., side=181.0, border=0.): 168 169 halfSide = (side + (border*2.0)) /2.0 170 self.getRegions(regionsToIngest, regionsToPurge, ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide) 171 172 ''' 173 Gets a bunch of region files from DVO for a RA/Dec box centered with these coords and with this side length 174 ''' 175 def getRegionsInThisBox(self, regionsToIngest, regionsToPurge, ra=180., dec=0., side=181.0): 176 177 halfSide = side/2.0 178 self.getRegions(regionsToIngest, regionsToPurge, ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide) 179 180 181 ''' 175 182 Gets a bunch of region files from DVO for this RA/Dec box 176 183 ''' 177 184 def getRegions(self, regionsToIngest, regionsToPurge, minRa=-1., maxRa=361., minDec=-91., maxDec=91): 178 185 186 # go no further if we've already partly ingested a different DVO 187 if not self.correctDvo: return 188 179 189 if (maxRa - minRa <= 0) or (maxDec - minDec) <= 0: 180 190 self.logger.errorPair("Zero range in either RA or Dec", … … 225 235 sizeOfRegionsToIngest = self.getFileSizeStr(self.getDiskSizeOfDvoRegions(regionsToIngest)) 226 236 227 self.logger.infoTitle(" DVO Overview")237 self.logger.infoTitle("Summary for this region") 228 238 self.logger.infoPair("RA range", "%.2f -> %.2f" % (minRa, maxRa)) 229 239 self.logger.infoPair("Dec range", "%.2f -> %.2f" % (minDec, maxDec)) … … 240 250 def purgeRegions(self, regions): 241 251 252 # go no further if we've already partly ingested a different DVO 253 if not self.correctDvo: return 254 242 255 if len(regions) < 1: return 243 256 … … 282 295 if not self.correctDvo: return 283 296 284 self.updateMetaTables() 297 # update the two meta tables, Images and SkyTable 298 self.loadImages() 299 self.loadSkyTable() 285 300 286 301 regionsToIngest = [] … … 302 317 cptTableName = self.scratchDb.getDbFriendlyTableName(region + ".cpt") 303 318 319 self.logger.infoTitle("Region: " + region) 320 304 321 # if we have not already ingested the cpm table, then do it now 305 322 if not self.scratchDb.alreadyImportedThisDvoTable(cpmPath): 306 323 307 self.logger.infoTitle("Region: " + region)308 309 324 # import cpm table and index 310 325 self.importFits(
Note:
See TracChangeset
for help on using the changeset viewer.
