Changeset 35063
- Timestamp:
- Jan 27, 2013, 5:58:25 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20121219/ippToPsps
- Files:
-
- 1 added
- 15 edited
-
config/ippToPspsDbSchema.sql (modified) (1 diff)
-
config/settings.xml (modified) (2 diffs)
-
doc/upgrade.txt (modified) (1 diff)
-
jython/detectionbatch.py (modified) (1 diff)
-
jython/dvo.py (modified) (3 diffs)
-
jython/dvoobjects.py (modified) (1 diff)
-
jython/gpc1db.py (modified) (1 diff)
-
jython/ipptopsps.py (modified) (2 diffs)
-
jython/ipptopspsdb.py (modified) (3 diffs)
-
jython/loader.py (modified) (1 diff)
-
jython/scratchdb.py (modified) (1 diff)
-
jython/setupScratchDb.py (modified) (1 diff)
-
test/fulltest.sh (modified) (12 diffs)
-
test/mkgpc1data.dvo (modified) (4 diffs)
-
test/partest.sh (added)
-
test/sastest.sh (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/ippToPsps/config/ippToPspsDbSchema.sql
r33753 r35063 122 122 `queue_OB` tinyint(1) default '0', 123 123 `active` tinyint(1) default '1', 124 `parallel` tinyint(1) default '0', 124 125 UNIQUE KEY `name` (`name`) 125 126 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -
branches/eam_branches/ipp-20121219/ippToPsps/config/settings.xml
r35058 r35063 8 8 <logPath>logs</logPath> 9 9 10 <!-- local scratch Db section -->10 <!-- local scratch Db section (REAL version) --> 11 11 <localdatabase> 12 <name>ipptopsps_ test_scratch</name>13 <host> localhost</host>12 <name>ipptopsps_scratch</name> 13 <host>ipp005</host> 14 14 <user>dvo</user> 15 15 <password>dvo</password> 16 16 </localdatabase> 17 17 18 <!-- GPC1 Db section -->18 <!-- GPC1 Db section (REAL version) --> 19 19 <gpc1database> 20 <!-- TEST VERSION21 <name>gpc1test</name>22 <host>localhost</host>23 <user>dvo</user>24 <password>dvo</password> -->25 <!-- REAL VERSION -->26 20 <name>gpc1</name> 27 21 <host>ippdb01</host> … … 30 24 </gpc1database> 31 25 32 <!-- ippToPsps Db section -->26 <!-- ippToPsps Db section (REAL version) --> 33 27 <ipptopspsdatabase> 28 <name>ipptopsps</name> 29 <host>localhost</host> 30 <user>dvo</user> 31 <password>dvo</password> 32 </ipptopspsdatabase> 33 34 <!-- local scratch Db section (TEST VERSION) --> 35 <localdatabase_test> 36 <name>ipptopsps_test_scratch</name> 37 <host>localhost</host> 38 <user>dvo</user> 39 <password>dvo</password> 40 </localdatabase_test> 41 42 <!-- GPC1 Db section (TEST VERSION) --> 43 <gpc1database_test> 44 <name>gpc1test</name> 45 <host>localhost</host> 46 <user>dvo</user> 47 <password>dvo</password> 48 </gpc1database_test> 49 50 <!-- ippToPsps Db section (TEST VERSION) --> 51 <ipptopspsdatabase_test> 34 52 <name>ipptopsps_test</name> 35 53 <host>localhost</host> 36 54 <user>dvo</user> 37 55 <password>dvo</password> 38 </ipptopspsdatabase >56 </ipptopspsdatabase_test> 39 57 40 58 <!-- Czar Db section --> -
branches/eam_branches/ipp-20121219/ippToPsps/doc/upgrade.txt
r35062 r35063 1 2 2013.01.26 3 4 I have modified the methods which create the StackDetectionCalib and 5 DetectionCalib tables to change the sql from "INSERT / UPDATE" to 6 "SELECT / LOAD" operations. these need a target tmp directory 7 different from /tmp. the trick is that /tmp has permissions which 8 prevent my (joe-user) from removing the temp files in the jython code, 9 but mysql will not write over an existing file, nor will it write to 10 other random directories. the easy solution is to create a subdir in 11 /tmp for the output files. 12 13 This simple modification speeds up the processing of the smfs by a 14 factor of nearly 2x! 15 16 1 17 2 18 2013.01.24 : Status of the ippToPsps Upgrade -
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") -
branches/eam_branches/ipp-20121219/ippToPsps/test/fulltest.sh
r35051 r35063 25 25 # mkgpc1.sh user localhost eam eam 26 26 27 set mkgpc1 = 028 set initdb = 029 set mkdummy = 030 set initscratch = 031 set initbatch = 032 set camqueue = 033 set cambatch = 034 set stackqueue = 035 set stackbatch = 027 set mkgpc1 = 1 28 set initdb = 1 29 set mkdummy = 1 30 set initscratch = 1 31 set initbatch = 1 32 set camqueue = 1 33 set cambatch = 1 34 set stackqueue = 1 35 set stackbatch = 1 36 36 set objectqueue = 1 37 37 set objectbatch = 1 … … 56 56 # create a dummy config so setupScratchDb.py does not fail 57 57 if ($mkdummy) then 58 ippjython queue.py edit <<EOF58 ippjython queue.py -test edit <<EOF 59 59 dummy 60 60 none … … 80 80 0 81 81 1 82 0 82 83 EOF 83 84 endif … … 87 88 88 89 # create the database (ignore failure if it already exists) 89 mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_test_scratch "90 mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_test_scratch1" 90 91 # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch2" 91 92 # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch3" 92 93 93 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch "94 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test_scratch1" 94 95 # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch2" 95 96 # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch3" 96 97 97 ippjython setupScratchDb.py dummy ipptopsps_test_scratch98 # ippjython setupScratchDb.py dummy ipptopsps_scratch299 # ippjython setupScratchDb.py dummy ipptopsps_scratch398 ippjython setupScratchDb.py -test dummy ipptopsps_test_scratch1 99 # ippjython setupScratchDb.py -test dummy ipptopsps_scratch2 100 # ippjython setupScratchDb.py -test dummy ipptopsps_scratch3 100 101 endif 101 102 102 103 # this code is sensitive to a previously existing database? 103 104 if ($camqueue) then 104 ippjython queue.py edit <<EOF105 ippjython queue.py -test edit <<EOF 105 106 $queuename 106 107 test_ds … … 126 127 0 127 128 1 129 0 128 130 y 129 131 y … … 133 135 if ($initbatch) then 134 136 rm -rf $OUTDIR/IN 135 ippjython loader.py $queuename init137 ippjython loader.py -test $queuename init 136 138 endif 137 139 138 140 if ($cambatch) then 139 141 rm -rf $OUTDIR/P2 140 ippjython loader.py $queuename once142 ippjython loader.py -test $queuename once 141 143 endif 142 144 … … 146 148 set stackqueuename = $queuename\_stk 147 149 endif 148 ippjython queue.py edit <<EOF150 ippjython queue.py -test edit <<EOF 149 151 $stackqueuename 150 152 test_ds … … 170 172 0 171 173 1 174 0 172 175 y 173 176 y … … 180 183 endif 181 184 rm -rf $OUTDIR/ST 182 ippjython loader.py $stackqueuename once185 ippjython loader.py -test $stackqueuename once 183 186 endif 184 187 … … 188 191 set objectqueuename = $queuename\_obj 189 192 endif 190 ippjython queue.py edit <<EOF193 ippjython queue.py -test edit <<EOF 191 194 $objectqueuename 192 195 test_ds … … 212 215 1 213 216 1 217 0 214 218 y 215 219 y … … 222 226 endif 223 227 rm -rf $OUTDIR/OB 224 ippjython loader.py$objectqueuename once225 endif 226 228 ippjython loader.py -test $objectqueuename once 229 endif 230 -
branches/eam_branches/ipp-20121219/ippToPsps/test/mkgpc1data.dvo
r35051 r35063 4 4 5 5 if (not($?VERBOSE)) set VERBOSE = 0 6 if (not($?PARALLEL)) set PARALLEL = 0 6 7 7 8 ## this script must be run in this directory, output data goes to 'testdata' … … 199 200 end 200 201 202 if ($PARALLEL) 203 $hostname = `hostname` 204 exec rm -f $catdir/HostTable.dat 205 output $catdir/HostTable.dat 206 echo "# ID Hostname Catdir" 207 echo " 1 $hostname $catdir.p1" 208 echo " 2 $hostname $catdir.p2" 209 echo " 3 $hostname $catdir.p3" 210 output stdout 211 exec dvodist -out $catdir 212 end 213 201 214 # for i 0 $offset:n 202 215 # tapOK {abs(Mcal[$i] - Mcal[0] - $offset:$i) < 0.001} "Mcal $i" … … 239 252 240 253 exec addstar -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass 254 end 255 256 if ($PARALLEL) 257 $hostname = `hostname` 258 exec rm -f $catdir/HostTable.dat 259 output $catdir/HostTable.dat 260 echo "# ID Hostname Catdir" 261 echo " 1 $hostname $catdir.p1" 262 echo " 2 $hostname $catdir.p2" 263 echo " 3 $hostname $catdir.p3" 264 output stdout 265 exec dvodist -out $catdir 241 266 end 242 267 … … 358 383 359 384 if ($SCRIPT) 385 if ($argv:n > 0) 386 if ("$argv:0" == "-parallel") 387 $PARALLEL = 1 388 end 389 end 360 390 mkfull 361 391 exit 0 -
branches/eam_branches/ipp-20121219/ippToPsps/test/sastest.sh
r35037 r35063 19 19 # mkgpc1.sh user localhost eam eam 20 20 21 set mkgpc1 = 122 set initdb = 123 set mkdummy = 124 set initscratch = 125 set initbatch = 026 set camqueue = 027 set cambatch = 021 set mkgpc1 = 0 22 set initdb = 0 23 set mkdummy = 0 24 set initscratch = 0 25 set initbatch = 1 26 set camqueue = 1 27 set cambatch = 1 28 28 set stackqueue = 1 29 29 set stackbatch = 1 … … 41 41 # does the database already exist? 42 42 # XXX this command will blow away an existing database!! 43 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps "44 mysql -h localhost -u dvo -pdvo ipptopsps < $IPPTOPSPS_DATA/ippToPspsDbSchema.sql43 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_test" 44 mysql -h localhost -u dvo -pdvo ipptopsps_test < $IPPTOPSPS_DATA/ippToPspsDbSchema.sql 45 45 46 46 endif … … 48 48 # create a dummy config so setupScratchDb.py does not fail 49 49 if ($mkdummy) then 50 ippjython queue.py edit <<EOF50 ippjython queue.py -test edit <<EOF 51 51 dummy 52 52 none … … 72 72 0 73 73 1 74 0 75 1 74 76 EOF 75 77 endif … … 79 81 80 82 # create the database (ignore failure if it already exists) 81 mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch "83 mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch1" 82 84 # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch2" 83 85 # mysql -h localhost -u dvo -pdvo -e "drop database ipptopsps_scratch3" 84 86 85 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch "87 mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch1" 86 88 # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch2" 87 89 # mysql -h localhost -u dvo -pdvo -e "create database ipptopsps_scratch3" 88 90 89 ippjython setupScratchDb.py dummy ipptopsps_scratch90 # ippjython setupScratchDb.py dummy ipptopsps_scratch291 # ippjython setupScratchDb.py dummy ipptopsps_scratch391 ippjython setupScratchDb.py -test dummy ipptopsps_scratch1 92 # ippjython setupScratchDb.py -test dummy ipptopsps_scratch2 93 # ippjython setupScratchDb.py -test dummy ipptopsps_scratch3 92 94 endif 93 95 94 96 # this code is sensitive to a previously existing database? 95 97 if ($camqueue) then 96 ippjython queue.py edit <<EOF98 ippjython queue.py -test edit <<EOF 97 99 $queuename 98 100 test_ds … … 118 120 0 119 121 1 122 0 123 1 120 124 y 121 125 y … … 124 128 125 129 if ($initbatch) then 126 ippjython loader.py $queuename init130 ippjython loader.py -test $queuename init 127 131 endif 128 132 129 133 if ($cambatch) then 130 ippjython loader.py $queuename once134 ippjython loader.py -test $queuename once 131 135 endif 132 136 … … 136 140 set stackqueuename = $queuename\_stk 137 141 endif 138 ippjython queue.py edit <<EOF142 ippjython queue.py -test edit <<EOF 139 143 $stackqueuename 140 144 test_ds … … 160 164 0 161 165 1 166 0 167 1 162 168 y 163 169 y … … 169 175 set stackqueuename = $queuename\_stk 170 176 endif 171 ippjython loader.py $stackqueuename once177 ippjython loader.py -test $stackqueuename once 172 178 endif 173 179
Note:
See TracChangeset
for help on using the changeset viewer.
