IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 3, 2015, 11:23:52 AM (11 years ago)
Author:
heather
Message:

changes for forced warp / diff

File:
1 edited

Legend:

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

    r38095 r38358  
    169169
    170170       self.dropTableVerbose("StackApFlx")
    171        self.dropTableVerbose("StackApFlxEGUnc")
    172        self.dropTableVerbose("StackApFlxEGCon6")
    173        self.dropTableVerbose("StackApFlxEGCon8")
     171       self.dropTableVerbose("StackApFlxExGalUnc")
     172       self.dropTableVerbose("StackApFlxExGalCon6")
     173       self.dropTableVerbose("StackApFlxExGalCon8")
    174174
    175175       self.dropTableVerbose("StackPetrosian")
     
    360360            sqlLine.group("a."+filter+"raErr",         "b.X_PSF_SIG * b.PLTSCALE")
    361361            sqlLine.group("a."+filter+"decErr",        "b.Y_PSF_SIG * b.PLTSCALE")
    362             sqlLine.group("a."+filter+"sky",           "b.SKY / " + str(exptime))
    363             sqlLine.group("a."+filter+"skyErr",        "b.SKY_SIGMA / " + str(exptime))
     362#            sqlLine.group("a."+filter+"sky",           "b.SKY / " + str(exptime))
     363#            sqlLine.group("a."+filter+"skyErr",        "b.SKY_SIGMA / " + str(exptime))
    364364            sqlLine.group("a."+filter+"infoFlag",      "b.FLAGS")
    365365            sqlLine.group("a."+filter+"infoFlag2",     "b.FLAGS2 | a."+filter+"infoFlag2")
     
    451451            sqlLine.group("a."+filter+"PlateScale",    "b.PLTSCALE")
    452452            sqlLine.group("a."+filter+"ExtNSigma",     "b.EXT_NSIGMA")
    453 
     453            sqlLine.group("a."+filter+"sky",           "b.SKY / " + str(exptime))
     454            sqlLine.group("a."+filter+"skyErr",        "b.SKY_SIGMA / " + str(exptime))
    454455            sql = sqlLine.makeEquals("WHERE a." + filter + "ippDetectID = b.IPP_IDET")
    455456
     
    484485    '''
    485486    def populateStackModelFitExtra(self):
     487        tablename = "StackModelFitExtra"
    486488
    487489        self.logger.infoPair("Procesing table", "StackModelFitExtra")
    488490        self.insertDvoIDs("StackModelFitExtra", "StackObjectThin")
     491        self.scratchDb.createIndex(tablename, "objID")
    489492
    490493        # if we are going to add a key, do it here so it is useful
    491494        # self.scratchDb.createIndex(tablename, "objID")
     495
     496        #objid
     497        #uniquepsps id
     498        # ippobjid
     499        # randomstackobjid
     500        # stackdetectrowid
     501        # primarydetection
     502        #bestdetection
     503
     504        #g / r / i /z / y
     505
     506        self.logger.infoPair("inserting filter dependent cmf items into", tablename)
     507        for filter in self.filters:
     508            self.logger.infoPair("filter", filter)
     509
     510            stackID = self.stackIDs[filter]
     511            self.logger.infoPair(filter + "stackID = ", stackID)
     512
     513            if stackID <= 0: 
     514                self.logger.infoPair("no stack data for filter" , filter)
     515                continue
     516
     517            header = self.headerSet[filter]
     518            exptime = self.getKeyFloat(header, "%.5f", "EXPTIME")
     519
     520            # insert all the detections
     521            sqlLine = sqlUtility("UPDATE " + tablename + " AS a , " + filter + "SkyChip_xsrc AS b SET")
     522
     523            sqlLine.group("a."+filter+"haveData",      "'1'")
     524            sqlLine.group("a."+filter+"S2",          "b.G_S2")
     525            sqlLine.group("a."+filter+"logRT",          "b.G_RT")
     526            sqlLine.group("a."+filter+"logRA",          "b.G_RA")
     527           # sqlLine.group("a."+filter+"logC",          "b.G_C")
     528            sqlLine.group("a."+filter+"logA",          "b.G_A")
     529
     530            sqlLine.group("a."+filter+"bumpy",          "b.G_BUMPY")
     531            sqlLine.group("a."+filter+"halfLightRad",          "b.HALF_LIGHT_RADIUS")
     532            sql = sqlLine.makeEquals("WHERE a." + filter + "ippDetectID = b.IPP_IDET")
     533
     534            try:
     535                self.scratchDb.execute(sql)
     536            except:
     537                self.logger.errorPair('failed sql',sql)
     538                raise
     539
     540        self.deleteRowsWithNoStackData(tablename)
     541        self.tablesToExport.append(tablename)
     542
     543
     544
     545        # gippdetectic
     546        # gstackmeta
     547        # gS2
     548        # glogRT
     549        # glogRA
     550        # glogC
     551        # glogA
     552        # gbumpy
     553        # ghalfLightRad
     554
     555
     556
     557
     558
     559
     560
    492561
    493562        # currently, none of the fields defined by the table are generated
     
    735804    Populates the StackApFlxEG table
    736805    '''
    737     def populateStackApFlxEG(self, version):
    738 
    739         tablename = "StackApFlxEG" + version
     806    def populateStackApFlxExGal(self, version):
     807
     808        tablename = "StackApFlxExGal" + version
    740809
    741810        if self.config.camera == "simtest":
     
    794863            if radius < minRadius: continue
    795864            if radius > maxRadius: continue
    796             sqlLine.group(filter + prefix + "flxR" + str(radius),          "-999")
    797             sqlLine.group(filter + prefix + "flxR" + str(radius) + "Err",  "-999")
    798             sqlLine.group(filter + prefix + "flxR" + str(radius) + "Std",  "-999")
    799             sqlLine.group(filter + prefix + "flxR" + str(radius) + "Fill", "-999")
     865            pspsRadius = radius + 2
     866            sqlLine.group(filter + prefix + "flxR" + str(pspsRadius),          "-999")
     867            sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Err",  "-999")
     868            sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Std",  "-999")
     869            sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Fill", "-999")
    800870
    801871        sql = sqlLine.makeEquals("")
     
    11181188            self.populateStackApFlx()
    11191189
    1120             self.populateStackApFlxEG("Unc")
    1121             self.populateStackApFlxEG("Con6")
    1122             self.populateStackApFlxEG("Con8")
     1190            self.populateStackApFlxExGal("Unc")
     1191            self.populateStackApFlxExGal("Con6")
     1192            self.populateStackApFlxExGal("Con8")
    11231193
    11241194        # delete rows with no content. for the other tables, this is done in
Note: See TracChangeset for help on using the changeset viewer.