IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32033


Ignore:
Timestamp:
Aug 4, 2011, 11:51:03 AM (15 years ago)
Author:
rhenders
Message:

yet more logginf improvments; now using one, and only one, name for batches: P2, ST and IN

Location:
trunk/ippToPsps/jython
Files:
4 edited

Legend:

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

    r32021 r32033  
    4949        self.doc = doc
    5050        self.fits = fits
    51         if self.fits is not None:
    52             self.header = self.fits.getPrimaryHeader()
     51        if self.fits: self.header = self.fits.getPrimaryHeader()
    5352
    5453        # set up logging
     
    9291        # create a new batch
    9392        self.batchID = self.ippToPspsDb.createNewBatch(
    94                 self.getPspsBatchType(),
     93                self.batchType,
    9594                self.id,
    9695                survey,
     
    10099        # get local storage location from config
    101100        self.batchName = "B%08d" % self.batchID
    102         self.subDir = self.doc.find("localOutPath").text + "/" + self.getPspsBatchType() + "/" + dvoName
     101        self.subDir = self.doc.find("localOutPath").text + "/" + self.batchType + "/" + dvoName
    103102        self.localOutPath = self.subDir + "/" + self.batchName
    104103        if not os.path.exists(self.localOutPath): os.makedirs(self.localOutPath)
     
    111110        if not self.useFullTables: self.scratchDb.createDvoTables()
    112111
    113         self.everythingOK = True
    114 
    115     '''
    116     Destructor
    117     '''
    118     def __del__(self):
    119 
    120         self.logger.debug("Batch destructor")
    121 
    122     '''
    123     Prints metadata to the log
    124     '''
    125     def printMe(self):
    126 
     112        # dump stuff to the log
     113        self.logger.infoTitle("New " + self.batchType + " batch")
    127114        self.logger.infoPair("Batch name", self.batchName)
    128115        self.logger.infoPair("Survey", self.survey)
     
    130117        self.logger.infoPair("DVO location", self.dvoLocation)
    131118        self.logger.infoPair("Use full DVO tables?", "%d" % self.useFullTables)
     119
     120        if self.fits:
     121            self.logger.infoPair("Input FITS file", self.fits.getOriginalPath())
     122            self.logger.infoPair("Input FITS primary header", "%s cards found" % self.fits.getPrimaryHeaderCardCount())
     123
    132124        self.logger.infoPair("Output path", self.localOutPath)
     125
     126        self.everythingOK = True
     127
     128    '''
     129    Destructor
     130    '''
     131    def __del__(self):
     132
     133        self.logger.debug("Batch destructor")
    133134
    134135    '''
     
    169170        # batch information
    170171        root.attrib['name'] = self.batchName
    171         root.attrib['type'] = self.getPspsBatchType()
     172        root.attrib['type'] = self.batchType
    172173        root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    173174        if self.survey != "":
     
    253254            self.logger.error("Don't know this survey: '" + self.survey + "'")
    254255            return "NA"
    255 
    256     '''
    257     Gets PSPS friendly batch type TODO only use PSPS batch names, P2, ST etc
    258     '''
    259     def getPspsBatchType(self):
    260 
    261         if self.batchType == "init": return "IN"
    262         elif self.batchType == "detection": return "P2"
    263         elif self.batchType == "stack": return "ST"
    264         else: self.logger.error("Don't know this batch type: " + self.survey)
    265256
    266257    '''
     
    465456            return
    466457
    467         self.printMe()
    468458        self.createEmptyPspsTables()
    469459        self.importIppTables()
     
    475465
    476466        self.logger.infoPair("Batch......", "complete")
    477         self.logger.infoSeparator()
    478 
    479 
     467
     468
  • trunk/ippToPsps/jython/detectionbatch.py

    r32000 r32033  
    4343               ippToPspsDb,
    4444               camID,
    45                "detection",
     45               "P2",
    4646               gpc1Db.getCameraStageSmf(camID),
    4747               #"MD04") # TODO
     
    107107       self.ippToPspsDb.insertDetectionMeta(self.batchID, self.expID, self.filter)
    108108
    109     '''
    110     Prints metadata to the log
    111     '''
    112     def printMe(self):
    113 
    114         super(DetectionBatch, self).printMe()
    115 
    116         self.logger.infoPair("Cam ID", "%d" % self.id)
    117         self.logger.infoPair("Exp ID", "%d" % self.expID)
    118         self.logger.infoPair("Exp name", "%s" % self.expName)
    119         self.logger.infoPair("Distribution group", "%s" % self.distGroup)
     109       # dump stuff to log
     110       self.logger.infoPair("Cam ID", "%d" % self.id)
     111       self.logger.infoPair("Exp ID", "%d" % self.expID)
     112       self.logger.infoPair("Exp name", "%s" % self.expName)
     113       self.logger.infoPair("Distribution group", "%s" % self.distGroup)
    120114
    121115    '''
  • trunk/ippToPsps/jython/initbatch.py

    r32005 r32033  
    3737               ippToPspsDb,
    3838               0,
    39                "init",
     39               "IN",
    4040               None)
    4141
  • trunk/ippToPsps/jython/stackbatch.py

    r32000 r32033  
    4040               ippToPspsDb,
    4141               stackID,
    42                "stack",
     42               "ST",
    4343               gpc1Db.getStackStageCmf(stackID),
    4444               "3PI") # TODO
     
    9292           self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID'])
    9393
    94     '''
    95     Prints metadata to the log
    96     '''
    97     def printMe(self):
    98 
    99        super(StackBatch, self).printMe()
    100 
     94
     95       # dump stuff to log
    10196       self.logger.infoPair("Stack ID", "%d" % self.id)
    10297       self.logger.infoPair("Stack type", "%s" % self.stackType)
    10398       self.logger.infoPair("Skycell", "%s" % self.skycell)
    10499       self.logger.infoPair("Filter", "%s" % self.filter)
     100
    105101
    106102
Note: See TracChangeset for help on using the changeset viewer.