IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2015, 2:20:15 PM (11 years ago)
Author:
eugene
Message:

adjust md5sum code to put options into single location; test for AP_NPIX before trying to use in diffbatch; apply static plate scale in stackbatch; add FW source X,Y, ccdID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/diffbatch.py

    r38956 r38958  
    9898           self.number[num]= diffSkyFileID
    9999
    100 
    101 
    102100           self.logger.infoPair("getting diff" ," metadata")
    103101           self.logger.infoPair("for diff skyfile id ", str(diffSkyFileID))
     
    106104           self.logger.infoPair("ok, I guess that worked","now doing this")
    107105
     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)
    108108           if not meta:
    109109               self.logger.errorPair("Could not get", "diff metadata")
     
    132132           self.logger.infoPair("TessName ",tessName)
    133133           self.tessID[num] = self.scratchDb.getTessID(tessName)
    134        
     134
    135135           self.logger.infoPair("TessName ",tessName)
    136136       # XXX EAM 20140812 : I am hardwiring the parsing logic for RINGS vs LOCAL
     
    325325            sqlLine.group("DapFlux",          "AP_FLUX / " + expTimeString)
    326326            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)")
    329330        sqlLine.group("DkronFlux",        "KRON_FLUX / " + expTimeString)
    330331        sqlLine.group("DkronFluxErr",     "KRON_FLUX_ERR / " + expTimeString)
     
    568569        self.logger.infoPair("Importing DF tables with table match expression: ", tableRE)
    569570
     571        self.tablesLoaded = []
     572        self.haveApNpix = {}
     573
    570574        count = 0
    571575        for num in self.number:
     
    581585                return False
    582586       
     587            # this is an optional field, check for it in the table below
     588            self.haveApNpix[num] = 0
     589
    583590            # count = 0
    584591            for table in tables:
     
    587594                if not match: continue
    588595
    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)
    590605                table = stilts.tpipe(table, cmd='addcol table_index $0')
    591606                table = stilts.tpipe(table, cmd='explodeall')
    592607                 
    593             # drop any previous tables before import
    594                 self.scratchDb.dropTable(table.name+"_"+str(num))
     608                # drop any previous tables before import
     609                self.scratchDb.dropTable(myTable)
    595610                 
    596                  
    597             # IPP FITS files are littered with infinities, so remove these
     611                # IPP FITS files are littered with infinities, so remove these
    598612                self.logger.info("Removing Infinity values from all columns")
    599613                table = stilts.tpipe(table, cmd='keepcols "' + columns + '"')
     
    602616                 
    603617                try:
    604                     table.write(self.scratchDb.url + '#' +  table.name+"_"+str(num))
     618                    table.write(self.scratchDb.url + '#' +  myTable)
    605619                    count = count + 1
    606620                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")
    608622                     
    609623                self.logger.infoPair("Done. Imported", "%d tables" % count)
    610624                self.indexIppTables(num)
    611625                     
     626                self.tablesLoaded.append(myTable)
     627
    612628        return True
    613629
Note: See TracChangeset for help on using the changeset viewer.