Changeset 38958 for trunk/ippToPsps/jython/diffbatch.py
- Timestamp:
- Oct 24, 2015, 2:20:15 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/diffbatch.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/diffbatch.py
r38956 r38958 98 98 self.number[num]= diffSkyFileID 99 99 100 101 102 100 self.logger.infoPair("getting diff" ," metadata") 103 101 self.logger.infoPair("for diff skyfile id ", str(diffSkyFileID)) … … 106 104 self.logger.infoPair("ok, I guess that worked","now doing this") 107 105 106 # this code is very fragile: it depends on the right order in the output 107 # of the sql call in another file (see forcedwarpbatch.py for a better method) 108 108 if not meta: 109 109 self.logger.errorPair("Could not get", "diff metadata") … … 132 132 self.logger.infoPair("TessName ",tessName) 133 133 self.tessID[num] = self.scratchDb.getTessID(tessName) 134 134 135 135 self.logger.infoPair("TessName ",tessName) 136 136 # XXX EAM 20140812 : I am hardwiring the parsing logic for RINGS vs LOCAL … … 325 325 sqlLine.group("DapFlux", "AP_FLUX / " + expTimeString) 326 326 sqlLine.group("DapFluxErr", "AP_FLUX_SIG / " + expTimeString) 327 # sqlLine.group("DapFillF", "AP_NPIX / (3.14159265359 * AP_MAG_RADIUS * AP_MAG_RADIUS)") 328 # sqlLine.group("DapRadius", "AP_MAG_RADIUS") 327 328 if self.haveApNpix[num]: 329 sqlLine.group("DapFillF", "AP_NPIX / (3.14159265359 * AP_MAG_RADIUS * AP_MAG_RADIUS)") 329 330 sqlLine.group("DkronFlux", "KRON_FLUX / " + expTimeString) 330 331 sqlLine.group("DkronFluxErr", "KRON_FLUX_ERR / " + expTimeString) … … 568 569 self.logger.infoPair("Importing DF tables with table match expression: ", tableRE) 569 570 571 self.tablesLoaded = [] 572 self.haveApNpix = {} 573 570 574 count = 0 571 575 for num in self.number: … … 581 585 return False 582 586 587 # this is an optional field, check for it in the table below 588 self.haveApNpix[num] = 0 589 583 590 # count = 0 584 591 for table in tables: … … 587 594 if not match: continue 588 595 589 self.logger.infoPair("Reading IPP table", table.name+"_"+str(num)) 596 # check for AP_NPIX columns: missing for SAS39 597 if table.name == "SkyChip_psf": 598 columns = table.columns() 599 if 'AP_NPIX' in columns: 600 self.haveApNpix[num] = 1 601 602 myTable = table.name + "_" + str(num) 603 604 self.logger.infoPair("Reading IPP table", myTable) 590 605 table = stilts.tpipe(table, cmd='addcol table_index $0') 591 606 table = stilts.tpipe(table, cmd='explodeall') 592 607 593 # drop any previous tables before import594 self.scratchDb.dropTable( table.name+"_"+str(num))608 # drop any previous tables before import 609 self.scratchDb.dropTable(myTable) 595 610 596 597 # IPP FITS files are littered with infinities, so remove these 611 # IPP FITS files are littered with infinities, so remove these 598 612 self.logger.info("Removing Infinity values from all columns") 599 613 table = stilts.tpipe(table, cmd='keepcols "' + columns + '"') … … 602 616 603 617 try: 604 table.write(self.scratchDb.url + '#' + table.name+"_"+str(num))618 table.write(self.scratchDb.url + '#' + myTable) 605 619 count = count + 1 606 620 except: 607 self.logger.exception("Problem writing table '" + table.name+"_"+str(num)+ "' to the database")621 self.logger.exception("Problem writing table '" + myTable + "' to the database") 608 622 609 623 self.logger.infoPair("Done. Imported", "%d tables" % count) 610 624 self.indexIppTables(num) 611 625 626 self.tablesLoaded.append(myTable) 627 612 628 return True 613 629
Note:
See TracChangeset
for help on using the changeset viewer.
