IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31202 for trunk/ippToPsps


Ignore:
Timestamp:
Apr 6, 2011, 1:07:43 PM (15 years ago)
Author:
rhenders
Message:

method to fudge objIDs for time-being

File:
1 edited

Legend:

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

    r31183 r31202  
    3232       self.filter = self.filter[0:1]
    3333
    34        # create an output filename, which is {skycellID}{filterID}.FITS
    35        self.outputFitsPath = "%s%07d.FITS" % (self.filter, skyID);
     34       # create an output filename, which is {filterID}{skycellID}.FITS
     35       self.outputFitsFile = "%s%07d.FITS" % (self.filter, int(self.skycell));
     36       self.outputFitsPath = "%s/%s" % (self.localOutPath, self.outputFitsFile);
    3637
    3738       # set some constants
    … …  
    226227        self.updateFilterID("StackMeta")
    227228        self.updateStackTypeID("StackMeta")
     229        self.updateDataRelease("StackMeta")
    228230
    229231    '''
    … …  
    386388
    387389    '''
     390    '''
     391    def fudgeIDs(self):
     392
     393        self.log("Creating bogus IDs on all detections")
     394
     395        sql = "INSERT INTO dvo (ippDetectID) SELECT IPP_IDET FROM SkyChip_psf";
     396        self.localStmt.execute(sql)
     397
     398        sql = "SELECT ippDetectID FROM dvo"
     399        rs = self.localStmt.executeQuery(sql)
     400
     401        ids = []
     402        while (rs.next()):
     403            ids.append(rs.getInt(1))
     404
     405        i = 1
     406        o = 72010000000000001
     407
     408        for id in ids:
     409            sql = "UPDATE dvo SET ippObjID = %d, objID = %d WHERE ippDetectID = %s" % (i, o, id)
     410            self.localStmt.execute(sql)
     411            i = i + 1
     412            o = o + 1
     413
     414        self.updateDvoIDs("StackDetection")
     415        self.updateDvoIDs("StackApFlx")
     416        self.updateDvoIDs("StackModelFit")
     417       
     418        self.setMinMaxObjID("StackDetection")
     419
     420    '''
    388421    Does the processing, i.e. pulling stuff from IPP tables into PSPS tables
    389422    '''
    … …  
    405438
    406439    stackBatch = StackBatch(sky_id, file)
     440   
    407441    stackBatch.createEmptyPspsTables()
    408     stackBatch.importIppTables("")
     442    #stackBatch.importIppTables("")
    409443    stackBatch.populatePspsTables()
    410     stackBatch.reportNullsInAllPspsTables(False)
    411     #stackBatch.replaceAllPspsNulls("-999")
     444    stackBatch.fudgeIDs()
     445    #stackBatch.reportNullsInAllPspsTables(False)
     446    #stackBatch.replaceAllPspsNulls("-999") 
    412447    stackBatch.exportPspsTablesToFits()
     448    stackBatch.writeBatchManifest()
     449
    413450    i = i + 1
    414451    if i > 0: break # TODO just doing one filter for now
Note: See TracChangeset for help on using the changeset viewer.