IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37204


Ignore:
Timestamp:
Aug 7, 2014, 2:27:23 PM (12 years ago)
Author:
eugene
Message:

only select Chip detections for simtest camera; only use XYnn for gpc1; fix insert for objects

Location:
branches/eam_branches/ipp-20140717/ippToPsps/jython
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140717/ippToPsps/jython/detectionbatch.py

    r37133 r37204  
    257257        sqlLine.group("pc002002",         self.getKeyValue(header, 'PC002002'))
    258258        sqlLine.group("polyOrder",        self.getKeyValue(header, 'NPLYTERM'))
    259         sqlLine.group("pca1x3y0",         self.getKeyValue(header, 'PCA1X3Y0'))
    260         sqlLine.group("pca1x2y1",         self.getKeyValue(header, 'PCA1X2Y1'))
    261         sqlLine.group("pca1x1y2",         self.getKeyValue(header, 'PCA1X1Y2'))
    262         sqlLine.group("pca1x0y3",         self.getKeyValue(header, 'PCA1X0Y3'))
    263         sqlLine.group("pca1x2y0",         self.getKeyValue(header, 'PCA1X2Y0'))
    264         sqlLine.group("pca1x1y1",         self.getKeyValue(header, 'PCA1X1Y1'))
    265         sqlLine.group("pca1x0y2",         self.getKeyValue(header, 'PCA1X0Y2'))
    266         sqlLine.group("pca2x3y0",         self.getKeyValue(header, 'PCA2X3Y0'))
    267         sqlLine.group("pca2x2y1",         self.getKeyValue(header, 'PCA2X2Y1'))
    268         sqlLine.group("pca2x1y2",         self.getKeyValue(header, 'PCA2X1Y2'))
    269         sqlLine.group("pca2x0y3",         self.getKeyValue(header, 'PCA2X0Y3'))
    270         sqlLine.group("pca2x2y0",         self.getKeyValue(header, 'PCA2X2Y0'))
    271         sqlLine.group("pca2x1y1",         self.getKeyValue(header, 'PCA2X1Y1'))
    272         sqlLine.group("pca2x0y2",         self.getKeyValue(header, 'PCA2X0Y2'))
     259
     260        nPolyterm = int(self.getKeyValue(header, 'NPLYTERM'))
     261        if nPolyterm > 1:
     262            sqlLine.group("pca1x2y0",         self.getKeyValue(header, 'PCA1X2Y0'))
     263            sqlLine.group("pca1x1y1",         self.getKeyValue(header, 'PCA1X1Y1'))
     264            sqlLine.group("pca1x0y2",         self.getKeyValue(header, 'PCA1X0Y2'))
     265            sqlLine.group("pca2x2y0",         self.getKeyValue(header, 'PCA2X2Y0'))
     266            sqlLine.group("pca2x1y1",         self.getKeyValue(header, 'PCA2X1Y1'))
     267            sqlLine.group("pca2x0y2",         self.getKeyValue(header, 'PCA2X0Y2'))
     268        else:
     269            sqlLine.group("pca1x2y0",         "-999")
     270            sqlLine.group("pca1x1y1",         "-999")
     271            sqlLine.group("pca1x0y2",         "-999")
     272            sqlLine.group("pca2x2y0",         "-999")
     273            sqlLine.group("pca2x1y1",         "-999")
     274            sqlLine.group("pca2x0y2",         "-999")
     275           
     276        if nPolyterm > 2:
     277            sqlLine.group("pca1x3y0",         self.getKeyValue(header, 'PCA1X3Y0'))
     278            sqlLine.group("pca1x2y1",         self.getKeyValue(header, 'PCA1X2Y1'))
     279            sqlLine.group("pca1x1y2",         self.getKeyValue(header, 'PCA1X1Y2'))
     280            sqlLine.group("pca1x0y3",         self.getKeyValue(header, 'PCA1X0Y3'))
     281            sqlLine.group("pca2x3y0",         self.getKeyValue(header, 'PCA2X3Y0'))
     282            sqlLine.group("pca2x2y1",         self.getKeyValue(header, 'PCA2X2Y1'))
     283            sqlLine.group("pca2x1y2",         self.getKeyValue(header, 'PCA2X1Y2'))
     284            sqlLine.group("pca2x0y3",         self.getKeyValue(header, 'PCA2X0Y3'))
     285        else:
     286            sqlLine.group("pca1x3y0",         "-999")
     287            sqlLine.group("pca1x2y1",         "-999")
     288            sqlLine.group("pca1x1y2",         "-999")
     289            sqlLine.group("pca1x0y3",         "-999")
     290            sqlLine.group("pca2x3y0",         "-999")
     291            sqlLine.group("pca2x2y1",         "-999")
     292            sqlLine.group("pca2x1y2",         "-999")
     293            sqlLine.group("pca2x0y3",         "-999")
    273294
    274295        sql = sqlLine.make(") VALUES ( ", ")")
     
    491512        self.logger.infoPair("Reading", "FITS headers")
    492513        self.logger.infoPair("Populating table", "ImageMeta")
    493         for x in range(self.startX, self.endX):
    494             for y in range(self.startY, self.endY):
    495                
    496                 # dodge the corners
    497                 if x==0 and y==0: continue
    498                 if x==0 and y==7: continue
    499                 if x==7 and y==0: continue
    500                 if x==7 and y==7: continue
    501 
    502                 ota = "XY%d%d" % (x, y)
     514
     515        if self.config.camera == "gpc1":
     516            for x in range(self.startX, self.endX):
     517                for y in range(self.startY, self.endY):
     518                   
     519                    # dodge the corners
     520                    if x==0 and y==0: continue
     521                    if x==0 and y==7: continue
     522                    if x==7 and y==0: continue
     523                    if x==7 and y==7: continue
     524                   
     525                    ota = "XY%d%d" % (x, y)
    503526               
    504                 self.alterPspsTablesChip(ota, ota + ".hdr", x, y)
    505 
    506         # try the test Chip
    507         self.alterPspsTablesChip("Chip", "Chip.hdr", 0, 0)
     527                    self.alterPspsTablesChip(ota, ota + ".hdr", x, y)
     528
     529        if self.config.camera == "simtest":
     530            # try the test Chip
     531            self.alterPspsTablesChip("Chip", "Chip.hdr", 0, 0)
    508532
    509533        # now run DVO code to get all IDs ( XXX deprecated, uses dvograbber)
  • branches/eam_branches/ipp-20140717/ippToPsps/jython/objectbatch.py

    r37175 r37204  
    326326        # sqlLine.group("gcobjID",       "EXT_ID_GC")  # drop this one?
    327327        sqlLine.group("ippObjID",        "OBJ_ID + (CAT_ID << 32)") # NOTE: shift by 32 bits exactly
    328         sqlLine.group("surveyID",        str(self.surveyID))
    329         sqlLine.group("skyCellID",       "-999") # XXX This does not make sense
     328        sqlLine.group("surveyID",        "'" + str(self.surveyID) + "'")
     329        sqlLine.group("skyCellID",       "'-999'") # XXX This does not make sense
    330330        sqlLine.group("randomID",        "FLOOR(RAND()*9223372036854775807)") # XXX where does this number come from??
    331         sqlLine.group("batchID",         str(self.batchID))
     331        sqlLine.group("batchID",         "'" + str(self.batchID) + "'")
    332332        sqlLine.group("dvoRegionID",     "DVO_REGION") # XXX add to dvopsps output for cpt
    333         sqlLine.group("dataRelease",     str(self.skychunk.dataRelease))
     333        sqlLine.group("dataRelease",     "'" + str(self.skychunk.dataRelease) + "'")
    334334        sqlLine.group("objInfoFlag",     "FLAGS")
    335335        sqlLine.group("qualityFlag",     "FLAGS >> 24 & 0xFF")
    336         sqlLine.group("consistencyFlag", "0")
     336        sqlLine.group("consistencyFlag", "'0'")
    337337        sqlLine.group("raStack",         "RA_STK")
    338338        sqlLine.group("decStack",        "DEC_STK")
     
    343343        sqlLine.group("raMeanErr",       "RA_ERR")
    344344        sqlLine.group("decMeanErr",      "DEC_ERR")
    345         sqlLine.group("raMeanStd",       "-999") # XXX I do not calculate this, use chisq?
    346         sqlLine.group("decMeanStd",      "-999")
    347         sqlLine.group("nStackObjectRows", "0") # XXX I need to add / define this in dvopsps
    348         sqlLine.group("nStackDetections", "0")
    349         sqlLine.group("nDetections",      "0")
    350         sql = sqlLine.make(") SELECT ", " FROM " + cptTableName)
     345        sqlLine.group("raMeanStd",       "'-999'") # XXX I do not calculate this, use chisq?
     346        sqlLine.group("decMeanStd",      "'-999'")
     347        sqlLine.group("nStackObjectRows", "'0'") # XXX I need to add / define this in dvopsps
     348        sqlLine.group("nStackDetections", "'0'")
     349        sqlLine.group("nDetections",      "'0'")
     350        sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
    351351
    352352        try:
  • branches/eam_branches/ipp-20140717/ippToPsps/jython/stackbatch.py

    r37201 r37204  
    893893        self.scratchDb.execute(sql)
    894894
     895        for filter in self.filters:
     896            column = filter + "haveData"
     897            self.scratchDb.dropColumn(tableName, column)
     898
    895899    '''
    896900    Applies indexes to the PSPS tables
Note: See TracChangeset for help on using the changeset viewer.