IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2016, 4:20:30 PM (10 years ago)
Author:
heather
Message:

current state of ipptopsps for pv3 test batches (no fw merge yet)

File:
1 edited

Legend:

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

    r39165 r39544  
    286286        rs.close()
    287287
     288       
     289
    288290        return addIDs
    289291
     
    331333            self.logger.exception("Can't query for addIDs using :" + sql )
    332334
     335
    333336        addIDs = []
    334337        while (rs.next()):
     
    402405        if not rs.first():
    403406            self.logger.errorPair("Can't query for", "forced warp meta data")
     407            self.logger.errorPair("this failed", sql)
     408
    404409            os._exit(3)
    405410
     
    506511        if len(files) < 1: return None
    507512        fits = Fits(self.logger, self.config, files[0])
     513        self.logger.infoPair("cmf file",files[0])
    508514        return fits
    509515
     
    651657
    652658        return imageIDs
     659
     660
     661
     662    '''
     663    Gets a list of PSPS image IDs for this diff ID
     664    '''
     665    def getWarpSkyFileIDforThisAddIDforFW(self, addID):
     666
     667        self.logger.debug("Querying GPC1 for stage_extra1 for add ID: " + str(addID))
     668
     669
     670        sql = "select warp_skyfile_id from addRun join fullForceInput \
     671              on stage_id = ff_id and stage = 'fullforce' and stage_extra1 = warp_id \
     672              join fullForceRun using (ff_id) \
     673              join fullForceResult using (ff_id, warp_id) \
     674              JOIN skycalRun using (skycal_id) \
     675              join stackRun using (stack_id) \
     676              join warpImfile using (warp_id, skycell_id) \
     677              where add_id = "+str(addID)
     678        try:
     679            rs = self.executeQuery(sql)
     680        except:
     681            self.logger.infoPair("failed sql:",sql)
     682            self.logger.exception("Can't query for imageIDs")
     683           
     684
     685        #imageIDs = []
     686        #while (rs.next()):
     687        #    imageIDs.append(rs.getString(1))
     688        #rs.close()
     689
     690        rs.first()
     691        imageID=rs.getString(1)
     692        rs.close()
     693        return imageID
     694
     695    '''
     696    Gets a list of PSPS image IDs for this diff ID
     697    '''
     698    def getWarpSkyFileIDforThisAddIDforST(self, addID):
     699
     700        self.logger.debug("Querying GPC1 for stage_extra1 for add ID: " + str(addID))
     701
     702
     703        sql = "select warp_skyfile_id from addRun join skycalRun \
     704              on stage_id = skycal_id and stage = 'skycal' \
     705              join stackRun using (stack_id) \
     706              join warpImfile using (warp_id, skycell_id) \
     707              where add_id = "+str(addID)
     708        try:
     709            rs = self.executeQuery(sql)
     710        except:
     711            self.logger.infoPair("failed sql:",sql)
     712            self.logger.exception("Can't query for imageIDs")
     713           
     714
     715        #imageIDs = []
     716        #while (rs.next()):
     717        #    imageIDs.append(rs.getString(1))
     718        #rs.close()
     719
     720        rs.first()
     721        imageID=rs.getString(1)
     722        rs.close()
     723        return imageID
    653724
    654725   
     
    882953        # if we get here, then the cmf is readable, now check the stack_id
    883954        fits = Fits(self.logger, self.config, files[0])
     955        print self.logger.infoPair("cmf file",files[0])
    884956        return fits
    885957
Note: See TracChangeset for help on using the changeset viewer.