IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32065 for trunk/ippToPsps


Ignore:
Timestamp:
Aug 9, 2011, 4:18:54 PM (15 years ago)
Author:
rhenders
Message:

now getting psps survey from config; using gpc1 DVO name in path for output; no longer taking survey as constructor arg; purged method that supplied PSPS-friendly survey type, as this is now in the config

File:
1 edited

Legend:

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

    r32033 r32065  
    4141                 id,
    4242                 batchType,
    43                  fits,
    44                  survey=""):
     43                 fits):
    4544
    4645        self.everythingOK = False
     
    6261        self.batchType = batchType;
    6362        self.pspsVoTableFilePath = "../config/" + batchType + "/tables.vot"
    64         self.survey = survey
    65 
    66         # get dvo info from config
    67         dvoName = self.doc.find("dvo/name").text
     63
     64        # get info from config
     65        self.survey = self.doc.find("options/survey").text
     66        self.pspsSurvey = self.doc.find("options/pspsSurvey").text
    6867        dvoGpc1Label = self.doc.find("dvo/gpc1Label").text
    6968        self.dvoLocation = self.doc.find("dvo/location").text
     
    9392                self.batchType,
    9493                self.id,
    95                 survey,
     94                self.survey,
    9695                dvoGpc1Label,
    9796                self.datastore.product)
     
    9998        # get local storage location from config
    10099        self.batchName = "B%08d" % self.batchID
    101         self.subDir = self.doc.find("localOutPath").text + "/" + self.batchType + "/" + dvoName
     100        self.subDir = self.doc.find("localOutPath").text + "/" + self.batchType + "/" + dvoGpc1Label
    102101        self.localOutPath = self.subDir + "/" + self.batchName
    103102        if not os.path.exists(self.localOutPath): os.makedirs(self.localOutPath)
     
    115114        self.logger.infoPair("Survey", self.survey)
    116115        self.logger.infoPair("Survey ID", "%d" % self.surveyID)
     116        self.logger.infoPair("Publishing to PSPS as survey", self.pspsSurvey)
    117117        self.logger.infoPair("DVO location", self.dvoLocation)
    118         self.logger.infoPair("Use full DVO tables?", "%d" % self.useFullTables)
     118        self.logger.infoBool("Use full DVO tables?", self.useFullTables)
    119119
    120120        if self.fits:
     
    172172        root.attrib['type'] = self.batchType
    173173        root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    174         if self.survey != "":
    175             root.attrib['survey'] = self.getBatchFriendlySurveyType()
     174        if self.batchType != "IN": root.attrib['survey'] = self.pspsSurvey
    176175        try: self.minObjID
    177176        except: pass
     
    237236        if self.datastore.publish(self.batchName, self.subDir, tarballFile, "tgz"):
    238237            self.ippToPspsDb.updateLoadedToDatastore(self.batchID, 1)
    239 
    240     '''
    241     Gets PSPS-friendly survey type
    242     '''
    243     def getBatchFriendlySurveyType(self):
    244 
    245         #return "SCR" # TODO
    246         try:
    247             self.survey
    248         except:
    249             return "NA"
    250 
    251         if self.survey == "3PI": return "3PI"
    252         elif self.survey == "MD04": return "MD4"
    253         else:
    254             self.logger.error("Don't know this survey: '" + self.survey + "'")
    255             return "NA"
    256238
    257239    '''
Note: See TracChangeset for help on using the changeset viewer.