IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39764


Ignore:
Timestamp:
Oct 15, 2016, 10:01:32 AM (10 years ago)
Author:
heather
Message:

various changes over the past few weeks to fix bugs etc

Location:
trunk/ippToPsps/jython
Files:
5 edited

Legend:

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

    r39467 r39764  
    152152        self.scratchDb.execute("ALTER TABLE " + self.scratchDb.dvoImagesTable + " ADD PRIMARY KEY (IMAGE_ID, EXTERN_ID)")
    153153
     154        self.scratchDb.execute("CREATE INDEX externID_index ON dvoImagesFull (EXTERN_ID)")
    154155        self.scratchDb.setImportedThisDvoTable(path)
    155156        return True
  • trunk/ippToPsps/jython/fits.py

    r39694 r39764  
    147147
    148148        if False:
     149            self.logger.infoPair("running findAndReadHeaderRaw",name)
    149150            status = self.findAndReadHeaderRaw(name, VERBOSE)
    150151            return status
    151 
     152        self.logger.infoPair("running findAndReadHeaderOhana",name)
    152153        status = self.findAndReadHeaderOhana(name, VERBOSE)
    153154        return status
  • trunk/ippToPsps/jython/gpc1db.py

    r39544 r39764  
    659659
    660660
     661    '''
     662    Gets the exp_id from teh exp_name
     663    '''
     664    def getExpIdFromExpName(self, expName):
     665       sql = "SELECT exp_id from rawExp where exp_name = '"+expName+"'"
     666       try:
     667           rs = self.executeQuery(sql)
     668       except:
     669           self.logger.infoPair("failed sql:",sql)
     670           self.logger.exception("Can't query for imageIDs")
     671           
     672
     673       expIDs = []
     674       while (rs.next()):
     675           expIDs.append(rs.getString(1))
     676       rs.close()
     677       expID = expIDs[0]
     678       return expID
     679
     680   
     681
     682
    661683
    662684    '''
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r39158 r39764  
    11771177        if rs.getInt(23) == 1: self.skychunk.batchTypes.append("DO")
    11781178        if rs.getInt(24) == 1: self.skychunk.batchTypes.append("FW")
    1179         if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG")
     1179###        if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FG") fix this when P2 is done
    11801180        if rs.getInt(25) == 1: self.skychunk.batchTypes.append("FO")
    11811181
  • trunk/ippToPsps/jython/stackbatch.py

    r39728 r39764  
    129129           self.zpImage[filter] = self.getKeyFloat(header, "%.8f", 'ZPT_OBS')
    130130           self.zpError[filter] = self.getKeyFloat(header, "%.8f", 'ZPT_ERR')
    131 
    132            deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test)
    133            if not deteffHeader:
    134                if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter)
    135                return False
    136 
    137            self.magref[filter] = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF')
    138            self.nInjected[filter] = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM'))
     131           hasdeteff = 1           
     132           try: deteffHeader = self.fits[filter].findAndReadHeader("SkyChip.deteff", self.config.test)
     133           except:
     134               hasdeteff = 0
     135           #if not deteffHeader:
     136           #    if self.config.test: self.logger.errorPair("No header found for Skychip.deteff for", filter)
     137           #    return False
     138               
     139           if hasdeteff == 1:         
     140               self.magref[filter] = self.getKeyFloat(deteffHeader, "%.8f", 'DETEFF.MAGREF')
     141               self.nInjected[filter] = int(self.getKeyInt(deteffHeader, 0, 'DETEFF.NUM'))
    139142
    140143           ## MEH -- md5sum test
     
    11801183                # search the words for the o....g....o part
    11811184                for j in range(len(words)):
    1182                     match = re.search('o\d\d\d\dg\d\d\d\d\o', words[j])
    1183                     if (match != None):
     1185                    match1 = re.search('^\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading  o: then ones with borked no os and cs will work now
     1186                    match2 = re.search('\o\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading  o: then ones with borked no os and cs will work now
     1187                    match3 = re.search('\c\d\d\d\dg\d\d\d\d\o', words[j]) #remove leading  o: then ones with borked no os and cs will work now
     1188                    if (match1 != None):
    11841189                        ogo=j
     1190                        ogoname = 'o'+words[ogo]
     1191                        break
     1192                    if (match2 != None):
     1193                        ogo=j
     1194                        ogoname = words[ogo]
     1195                        break
     1196                    if (match3 != None):
     1197                        ogo=j
     1198                        ogoname = words[ogo]
    11851199                        break
    11861200                    # did we find it? if so, are there are least 2 more elements past the ogo?
     
    11881202
    11891203                if ogo > -1:
    1190                     if (ogo +1) < len(words):
     1204                    if (ogo +2) < len(words): #this was the mistake before
    11911205                        # there is a o....g....o element, and the next 2 exist
    11921206                        frameID = words[ogo+1]
    11931207                       
    1194                     else:
    1195                         self.logger.infoPair("unable to find exp_id from", inputName)
    1196                         raise
     1208                    else:
     1209                        #ogoname = "o"+words[ogo]
     1210                        try: frameID = self.gpc1Db.getExpIdFromExpName(ogoname)
     1211                        except:
     1212                            self.logger.error("cant get expid")
     1213                            raise
     1214                       
     1215#                        frameID = str(rs.getInt(1))
     1216       
     1217#                        self.logger.infoPair("unable to find exp_id from", inputName)
     1218#                        raise
    11971219                        # and then raise an error and stop the program. I expect this to mostly work fine
    11981220        # for the extra long label (?) - can probably get it from just the o g o (if exp_id
     
    12261248
    12271249        self.tablesToExport.append("StackToFrame")
     1250        return True
    12281251
    12291252    '''
     
    15061529            if self.stackIDs[filter] > 0:       
    15071530                self.populateStackMeta(filter)
    1508 
     1531               
    15091532        self.populateStackObjectThin()
    15101533
     
    15391562        self.logger.infoPair("populating","StackToImage")
    15401563        self.populateStackToImage()
    1541        
     1564       
     1565 
     1566       
    15421567        self.logger.infoPair("populating","StackToFrame")
    1543         self.populateStackToFrame()
     1568
     1569#        self.populateStackToFrame()
     1570        if not self.populateStackToFrame():
     1571                    self.logger.errorPair("can't populate"," stack to frame")
     1572                    return False
    15441573        self.logger.infoPair("removing frameID"," duplicates")
    15451574        self.scratchDb.execute("ALTER IGNORE TABLE StackToFrame ADD UNIQUE INDEX(frameID)")
Note: See TracChangeset for help on using the changeset viewer.