IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.