Changeset 35063 for branches/eam_branches/ipp-20121219/ippToPsps/jython
- Timestamp:
- Jan 27, 2013, 5:58:25 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121219/ippToPsps/jython
- Files:
-
- 9 edited
-
detectionbatch.py (modified) (1 diff)
-
dvo.py (modified) (3 diffs)
-
dvoobjects.py (modified) (1 diff)
-
gpc1db.py (modified) (1 diff)
-
ipptopsps.py (modified) (2 diffs)
-
ipptopspsdb.py (modified) (3 diffs)
-
loader.py (modified) (1 diff)
-
scratchdb.py (modified) (1 diff)
-
setupScratchDb.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/jython/detectionbatch.py
r35060 r35063 927 927 def importIppTables(self, filter=""): 928 928 929 if self.config.test: regex = "XY33.psf" 930 else : regex = ".*.psf" 929 ## if self.config.test: regex = "XY33.psf" 930 ## else : regex = ".*.psf" 931 regex = ".*.psf" 931 932 932 # XXX EAM NOTE : this is fragile : requires PS1_V _933 # XXX EAM NOTE : this is fragile : requires PS1_V4 933 934 columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ" 934 935 -
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvo.py
r35042 r35063 33 33 34 34 ''' 35 def __init__(self, logger, config, scratchDbName= "ipptopsps_test_scratch"):35 def __init__(self, logger, config, scratchDbName=None): 36 36 37 37 # set up logging … … 49 49 self.useStilts = 0 50 50 51 # connect to the specified scratch database 51 # connect to the specified scratch database, if a name is given, otherwise use the first version 52 52 try: 53 self.scratchDb = ScratchDb(self.logger, self.config, scratchDbName)53 self.scratchDb = ScratchDb(self.logger, self.config, '1', scratchDbName) 54 54 except: raise 55 55 … … 617 617 cmd += " " + str(decCenter+halfSize) 618 618 619 if self.config.parallel: 620 cmd += " -parallel" 621 619 622 self.logger.infoPair("Running dvopsps", cmd) 620 623 p = Popen(cmd, shell=True, stdout=PIPE) -
branches/eam_branches/ipp-20121219/ippToPsps/jython/dvoobjects.py
r35056 r35063 67 67 cmd += " -cpt " + region 68 68 69 if self.config.parallel: 70 cmd += " -parallel" 71 69 72 self.logger.infoPair("Running dvopsps", cmd) 70 73 p = Popen(cmd, shell=True, stdout=PIPE) -
branches/eam_branches/ipp-20121219/ippToPsps/jython/gpc1db.py
r35057 r35063 21 21 ''' 22 22 def __init__(self, logger, config): 23 super(Gpc1Db, self).__init__(logger, config, "gpc1database") 23 # define database type 24 if (config.test): 25 dbType = "gpc1database_test" 26 else: 27 dbType = "gpc1database" 28 29 super(Gpc1Db, self).__init__(logger, config, dbType) 24 30 25 31 ''' -
branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopsps.py
r34970 r35063 22 22 ''' 23 23 def __init__(self, argv, logToStdout=1, logToFile=0): 24 25 testmode = False 26 for arg in sys.argv: 27 if arg == "-test": 28 testmode = True 29 sys.argv.remove(arg) 30 if arg == "-t": 31 testmode = True 32 sys.argv.remove(arg) 24 33 25 34 # are the arsg ok? all programs require a config name … … 51 60 # set up config object 52 61 self.config = Config(self.PROGNAME, CONFIGNAME, self.configDir) 62 self.config.test = testmode 63 64 if self.config.test: print "using test mode" 65 else: print "not using test mode" 66 53 67 self.logger = self.config.getLogger(self.HOST, self.PID, logToStdout, logToFile) 54 68 -
branches/eam_branches/ipp-20121219/ippToPsps/jython/ipptopspsdb.py
r35003 r35063 18 18 ''' 19 19 def __init__(self, logger, config): 20 super(IppToPspsDb, self).__init__(logger, config, "ipptopspsdatabase") 20 if (config.test): 21 dbType = "ipptopspsdatabase_test" 22 else: 23 dbType = "ipptopspsdatabase" 24 super(IppToPspsDb, self).__init__(logger, config, dbType) 21 25 22 26 self.MAX_FAILS = 5 … … 965 969 ,queue_ST \ 966 970 ,queue_OB \ 971 ,parallel \ 967 972 FROM config \ 968 973 WHERE name = '" + self.config.name + "'" … … 1006 1011 if rs.getInt(20) == 1: self.config.batchTypes.append("ST") 1007 1012 if rs.getInt(21) == 1: self.config.batchTypes.append("OB") 1013 1008 1014 self.config.force = True # TODO 1009 self.config.test = False # TODO 1015 self.config.parallel = False # TODO 1016 1017 if rs.getInt(22) == 1: self.config.parallel = True 1018 1019 if self.config.parallel: print "USING parallel" 1010 1020 self.config.isLoaded = True 1011 1021 except: -
branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py
r35056 r35063 34 34 super(Loader, self).__init__(argv, 1, 1) 35 35 36 # create gpc1 database objects 36 if self.config.parallel: 37 print "PARALLEL dvo" 38 else: 39 print "SERIAL dvo" 40 41 # connect to the gpc1 database 37 42 self.gpc1Db = Gpc1Db(self.logger, self.config) 38 43 39 # XXX this is really bad: need to get these from config... (see this code:)40 ## XX # open config and grab database parameters41 ## XX if not dbName: self.dbName = config.getDbName(dbType)42 ## XX else: self.dbName = dbName43 44 44 # connect to scratch database 45 scratchDbs = [' ipptopsps_test_scratch', 'ipptopsps_test_scratch2', 'ipptopsps_test_scratch3']46 for db Namein scratchDbs:47 self.scratchDb = ScratchDb(self.logger, self.config, db Name)48 if self.scratchDb.anyOtherConnections():49 self.logger.errorPair("This scratch Db is already in use", dbName)45 scratchDbs = ['1', '2', '3'] 46 for dbVersion in scratchDbs: 47 self.scratchDb = ScratchDb(self.logger, self.config, dbVersion) 48 if not self.config.test and self.scratchDb.anyOtherConnections(): 49 self.logger.errorPair("This scratch Db is already in use", self.scratchDb.dbName) 50 50 self.scratchDb.disconnect() 51 51 continue -
branches/eam_branches/ipp-20121219/ippToPsps/jython/scratchdb.py
r35042 r35063 19 19 Constructor 20 20 ''' 21 def __init__(self, logger, config, dbName=None): 22 super(ScratchDb, self).__init__(logger, config, "localdatabase", dbName) 21 def __init__(self, logger, config, dbVersion, dbName=None): 22 23 # create gpc1 database objects 24 if (config.test): 25 dbType = "localdatabase_test" 26 else: 27 dbType = "localdatabase" 28 29 if not dbName: 30 dbName = config.getDbName(dbType) 31 dbName += dbVersion 32 33 super(ScratchDb, self).__init__(logger, config, dbType, dbName) 23 34 24 35 self.dvoDoneTable = "dvoDone" -
branches/eam_branches/ipp-20121219/ippToPsps/jython/setupScratchDb.py
r34990 r35063 26 26 27 27 try: 28 self.scratchDb = ScratchDb(self.logger, self.config, argv[2])28 self.scratchDb = ScratchDb(self.logger, self.config, '0', argv[2]) 29 29 except: 30 30 self.exitProgram("Could not connect to a scratch Db")
Note:
See TracChangeset
for help on using the changeset viewer.
