IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2015, 5:03:38 PM (11 years ago)
Author:
watersc1
Message:

Add popular and alternate names, and receive IAU and PSO names from dvopsps call.

File:
1 edited

Legend:

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

    r39075 r39255  
    210210    def updateDiffObjName(self):
    211211    ##this is a 2 part update:
    212 
    213         self.logger.infoPair("updating diffObjName", "using means")
    214     ## use mean ra and dec (dec >= 0)
    215         sql = "update DiffDetObject set diffObjName =  concat('PSO J', \
    216         lpad(floor(ra/15.),2,'0'), \
    217         lpad(format((ra/15. - (floor(ra/15.)))*60.,0), 2, '0'), \
    218         lpad(format(((ra/15. - (floor(ra/15.)))*60. - floor((ra/15.-(floor(ra/15.)))*60.))*60.,2),5,'0'), \
    219         '+', \
    220         lpad(floor(abs(dec_)),2,'0'), \
    221         lpad(format((abs(dec_)-(floor(abs(dec_))))*60.,0), 2, '0'), \
    222         lpad(format(((abs(dec_)-(floor(abs(dec_))))*60.-floor((abs(dec_)-(floor(abs(dec_))))*60.))*60.,2),5,'0') \
    223         ) where ra > -999 and dec_ > -999 and dec_ >= 0"
    224 
    225         try:
    226             self.scratchDb.execute(sql)
    227         except:
    228             self.logger.errorPair("failed sql", sql)
    229             raise
    230  
    231     ## use mean ra and dec (dec < 0)
    232 
    233         sql = "update DiffDetObject set diffObjName =  concat('PSO J', \
    234         lpad(floor(ra/15.),2,'0'), \
    235         lpad(format((ra/15. - (floor(ra/15.)))*60.,0), 2, '0'), \
    236         lpad(format(((ra/15. - (floor(ra/15.)))*60. - floor((ra/15.-(floor(ra/15.)))*60.))*60.,2),5,'0'), \
    237         '-', \
    238         lpad(floor(abs(dec_)),2,'0'), \
    239         lpad(format((abs(dec_)-(floor(abs(dec_))))*60.,0), 2, '0'), \
    240         lpad(format(((abs(dec_)-(floor(abs(dec_))))*60.-floor((abs(dec_)-(floor(abs(dec_))))*60.))*60.,2),5,'0') \
    241         ) where ra > -999 and dec_ > -999 and dec_ < 0"
    242 
    243         try:
    244             self.scratchDb.execute(sql)
    245         except:
    246             self.logger.errorPair("failed sql", sql)
    247             raise
    248 
    249         ## Update altName with decimal form
    250         self.logger.infoPair("updating diffObjAltName1", "using means")
    251        
    252         sql = "update DiffDetObject SET diffObjAltName1 = concat('PSO J', \
    253         format(ra,4),'+',format(dec_,4)) where ra > -999 AND dec_ > -999 AND dec_ >= 0 "
    254 
    255         try:
    256             self.scratchDb.execute(sql)
    257         except:
    258             self.logger.errorPair("failed sql", sql)
    259             raise
    260             return False
    261 
    262         sql = "update DiffDetObject SET diffObjAltName1 = concat('PSO J', \
    263         format(ra,4),format(dec_,4)) where ra > -999 AND dec_ > -999 AND dec_ < 0"
    264 
    265         try:
    266             self.scratchDb.execute(sql)
    267         except:
    268             self.logger.errorPair("failed sql", sql)
    269             raise
    270             return False
    271 
     212        self.logger.info("Names are now populated with the populateDiffObjectTable call")
     213
     214        return True
    272215
    273216    '''
     
    322265        sqlLine.group("ra",                "RA_MEAN")
    323266        sqlLine.group("dec_",              "DEC_MEAN")
     267        sqlLine.group("diffObjName",       "IAU_NAME")
     268        sqlLine.group("diffObjPSOName",    "PSO_NAME")
    324269        sqlLine.group("nDetections",       "'0'")
    325270        sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
Note: See TracChangeset for help on using the changeset viewer.