IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34103


Ignore:
Timestamp:
Jun 28, 2012, 9:47:11 AM (14 years ago)
Author:
eugene
Message:

add function to get filterCount from Photcode table; add example Photcode table fits file in doc directory

Location:
branches/eam_branches/ipp-20120627/ippToPsps
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120627/ippToPsps/jython/dvo.py

    r33787 r34103  
    111111        self.importFits(
    112112                path,
    113                 "CODE NAME",
     113                "CODE NAME TYPE",
    114114                self.scratchDb.dvoPhotcodesTable)
    115115        self.logger.infoPair("Adding primary key to", self.scratchDb.dvoPhotcodesTable)
  • branches/eam_branches/ipp-20120627/ippToPsps/jython/objectbatch.py

    r33787 r34103  
    105105   
    106106        # get a count of the available filters
    107         filterCount = len(filters)
     107        filterCount = self.scratchDb.getCountOfFiltersFromPhotcodesTable()
     108        # filterCount = len(filters)
    108109
    109110        self.logger.infoPair("Available filters in Photcodes", filters)
  • branches/eam_branches/ipp-20120627/ippToPsps/jython/scratchdb.py

    r33833 r34103  
    544544
    545545    '''
     546    Gets a count of average filters (secfilt) in the DVO Photcodes table
     547    '''
     548    def getCountOfFiltersFromPhotcodesTable(self):
     549
     550        # 2 is hardwired -- convert to an enum (should probably read Ohana/src/libdvo/include/dvo.h defines
     551        sql = "SELECT count(TYPE) FROM " + self.dvoPhotcodesTable + " WHERE TYPE = 2"
     552
     553        filterCount = 0
     554        try:
     555            rs = self.executeQuery(sql)
     556            row = 1
     557            while (rs.next()):
     558                filterCount = rs.getString(1)
     559            rs.close()
     560        except:
     561            self.logger.errorPair("Could not get filter count", sql )
     562
     563        return filterCount
     564
     565    '''
    546566    Gets a list of filters ordered as thy are in the DVO Photcodes table, as this reflects the order they apper in the cps file
    547567    '''
    548568    def getOrderedListOfFiltersFromPhotcodesTable(self, interestedFilters):
     569
     570        sql = "SELECT count(TYPE) FROM " + self.dvoPhotcodesTable + " WHERE TYPE = 'sec'"
    549571
    550572        sql = "SELECT NAME FROM " + self.dvoPhotcodesTable + " WHERE "
Note: See TracChangeset for help on using the changeset viewer.