Changeset 38990
- Timestamp:
- Oct 28, 2015, 7:55:59 AM (11 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 7 edited
-
jython/batch.py (modified) (3 diffs)
-
jython/config.py (modified) (1 diff)
-
jython/dvo.py (modified) (3 diffs)
-
jython/forcedwarpbatch.py (modified) (1 diff)
-
jython/scratchdb.py (modified) (4 diffs)
-
test/fulltest.sh (modified) (14 diffs)
-
test/mkgpc1data.dvo (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/batch.py
r38987 r38990 452 452 Accepts a regular expression filter so not all tables need to be imported 453 453 ''' 454 def importIppTables(self, columns="*", filter=""): 455 if self.useOhanaMYSQLtoFITS: 456 if not self.importIppTablesOhana(): 457 self.logger.errorPair("problem running", "importIppTablesOhana") 458 return False 459 else: 460 if not self.importIppTablesStilts(columns, filter): 461 self.logger.errorPair("problem running", "importIppTablesStilts") 462 return False 463 464 return True 465 466 ''' 467 Imports IPP tables from FITS file 468 469 Accepts a regular expression filter so not all tables need to be imported 470 ''' 454 471 def importIppTablesOhana(self): 455 472 … … 463 480 return False 464 481 465 loadFITStoMYSQL(self.fits.getPath(), "none")482 self.scratchDb.loadFITStoMYSQL(self.fits.getPath(), "none") 466 483 467 484 ## may need to do this with direct sql: … … 496 513 Accepts a regular expression filter so not all tables need to be imported 497 514 ''' 498 def importIppTables (self, columns="*", filter=""):515 def importIppTablesStilts(self, columns="*", filter=""): 499 516 500 517 self.logger.infoPair("Importing tables with filter", filter) -
trunk/ippToPsps/jython/config.py
r38973 r38990 21 21 def __init__(self): 22 22 23 self.useOhanaMYSQLtoFITS = False 23 24 self.test = False 24 25 self.resetDvo = False -
trunk/ippToPsps/jython/dvo.py
r38981 r38990 589 589 Imports the Photcode file 590 590 ''' 591 def importPhotcodes(self, path, tableName): 592 if True: 593 self.importPhotcodesOhana(path,tableName) 594 else: 595 self.importPhotcodesStilts(path,tableName) 596 597 ''' 598 Imports the Photcode file 599 ''' 591 600 def importPhotcodesOhana(self, path, tableName): 592 601 593 self.logger.infoPair("Importing file ", "%s (%s)" % (path, self.getFileSizeStr(self.getDiskSize(path))))602 self.logger.infoPair("Importing file with ohana", "%s (%s)" % (path, self.getFileSizeStr(self.getDiskSize(path)))) 594 603 self.logger.debugPair("Writing to database table", tableName) 595 604 … … 598 607 # table = stilts.tpipe(table, cmd='addcol -after TYPE TYPE_AS_INT "TYPE + 0"') 599 608 600 loadFITStoMYSQL (path, tableName)609 self.scratchDb.loadFITStoMYSQL (path, tableName) 601 610 602 611 self.logger.debugPair("Finished importing", tableName) … … 607 616 Imports the Photcode file 608 617 ''' 609 def importPhotcodes (self, path, tableName):618 def importPhotcodesStilts(self, path, tableName): 610 619 611 620 self.logger.infoPair("Importing file", "%s (%s)" % (path, self.getFileSizeStr(self.getDiskSize(path)))) -
trunk/ippToPsps/jython/forcedwarpbatch.py
r38960 r38990 459 459 results= self.scratchDb.reportAndDeleteRowsWithNULLS("ForcedWarpMeasurement_"+forcedWarpID, "objID") 460 460 rowCountAfter = self.scratchDb.getRowCount("ForcedWarpMeasurement_"+forcedWarpID) 461 self.logger.infoPair("row count of ForcedWarpMeasurement", rowCountBefore)461 self.logger.infoPair("row count of ForcedWarpMeasurement", rowCountBefore) 462 462 self.logger.infoPair("row count of ForcedWarpMeasurement after cull of null objID ", rowCountAfter) 463 463 if rowCountAfter == 0: 464 464 self.skipBatch = True 465 self.logger.infoPair ("skip this batch ,it is bad")465 self.logger.infoPair ("skip this batch", "it is bad") 466 466 return False 467 467 # self.generateRandomIDs() -
trunk/ippToPsps/jython/scratchdb.py
r38981 r38990 5 5 import os 6 6 import logging 7 import tempfile 8 from subprocess import call, PIPE, Popen 7 9 8 10 from java.lang import * … … 809 811 def loadFITStoMYSQL(self, filename, tablename): 810 812 813 self.logger.infoPair("starting loadFITStoMYSQL: ", filename) 814 811 815 # TODO path to DVO prog hardcoded temporarily 812 cmd = "fits_to_mysql" 813 cmd += " -dbhost " + self.scratchDb.dbHost 814 cmd += " -dbname " + self.scratchDb.dbName 815 cmd += " -dbuser " + self.scratchDb.dbUser 816 cmd += " -dbpass " + self.scratchDb.dbPass 817 cmd += filename 816 cmd = "fits_to_mysql " + filename 817 cmd += " -dbhost " + self.dbHost 818 cmd += " -dbname " + self.dbName 819 cmd += " -dbuser " + self.dbUser 820 cmd += " -dbpass " + self.dbPass 821 822 self.logger.debugPair("preparing command: ", cmd) 818 823 819 824 if tablename != "none": … … 822 827 (stdoutFile, stdoutName) = tempfile.mkstemp(prefix="fits_to_mysql.stdout.", dir="/tmp") 823 828 (stderrFile, stderrName) = tempfile.mkstemp(prefix="fits_to_mysql.stderr.", dir="/tmp") 829 830 self.logger.debugPair("generated tmpfiles: ", cmd) 824 831 825 832 self.logger.infoPair("Running fits_to_mysql", cmd) … … 838 845 os._exit(1) 839 846 840 os.close( loadFITStoMYSQL)841 os.close( loadFITStoMYSQL)847 os.close(stdoutFile) 848 os.close(stderrFile) -
trunk/ippToPsps/test/fulltest.sh
r38974 r38990 29 29 set forcedobjqueue = 1 30 30 set forcedobjbatch = 1 31 32 set debug = "" 31 33 32 34 set targ = ($argv) … … 89 91 set forcedobjqueue = 0 90 92 set forcedobjbatch = 0 93 breaksw; 94 case -debug 95 set debug = "-debug" 91 96 breaksw; 92 97 default: … … 246 251 echo "2000-01-01 00:00:00.0 " >> initbatch.dat # trange_start 247 252 echo "2020-01-01 00:00:00.0 " >> initbatch.dat # trange_end 248 ippjython queue.py -test edit < initbatch.dat253 ippjython queue.py $debug -test edit < initbatch.dat 249 254 if ($status) exit 1 250 255 … … 253 258 254 259 rm -rf $OUTDIR/IN 255 ippjython loader.py -test initbatch init -simtest < /dev/null260 ippjython loader.py $debug -test initbatch init -simtest < /dev/null 256 261 if ($status) exit 1 257 262 endif … … 296 301 echo "2000-01-01 00:00:00.0 " >> cambatch.dat # trange_start 297 302 echo "2020-01-01 00:00:00.0 " >> cambatch.dat # trange_end 298 ippjython queue.py -test edit -simtest < cambatch.dat303 ippjython queue.py $debug -test edit -simtest < cambatch.dat 299 304 if ($status) exit 1 300 305 endif … … 305 310 306 311 rm -rf $OUTDIR/P2 307 ippjython loader.py -test $queuename once -simtest < /dev/null312 ippjython loader.py $debug -test $queuename once -simtest < /dev/null 308 313 if ($status) exit 309 314 endif … … 348 353 echo "2000-01-01 00:00:00.0 " >> objectbatch.dat # trange_start 349 354 echo "2020-01-01 00:00:00.0 " >> objectbatch.dat # trange_end 350 ippjython queue.py -test edit once -simtest < objectbatch.dat355 ippjython queue.py $debug -test edit once -simtest < objectbatch.dat 351 356 if ($status) exit 352 357 endif … … 358 363 rm -rf $OUTDIR/OB 359 364 360 ippjython loader.py -test $objectqueuename once -simtest < /dev/null365 ippjython loader.py $debug -test $objectqueuename once -simtest < /dev/null 361 366 if ($status) exit 362 367 endif … … 401 406 echo "2000-01-01 00:00:00.0 " >> stackbatch.dat # trange_start 402 407 echo "2020-01-01 00:00:00.0 " >> stackbatch.dat # trange_end 403 ippjython queue.py -test edit -simtest < stackbatch.dat408 ippjython queue.py $debug -test edit -simtest < stackbatch.dat 404 409 if ($status) exit 405 410 endif … … 410 415 411 416 rm -rf $OUTDIR/ST 412 ippjython loader.py -test $stackqueuename once -simtest < /dev/null417 ippjython loader.py $debug -test $stackqueuename once -simtest < /dev/null 413 418 if ($status) exit 414 419 endif … … 453 458 echo "2000-01-01 00:00:00.0 " >> forcebatch.dat # trange_start 454 459 echo "2020-01-01 00:00:00.0 " >> forcebatch.dat # trange_end 455 ippjython queue.py -test edit -simtest < forcebatch.dat460 ippjython queue.py $debug -test edit -simtest < forcebatch.dat 456 461 if ($status) exit 1 457 462 endif … … 462 467 463 468 rm -rf $OUTDIR/FW 464 ippjython loader.py -test $forcedwarpqueuename once -simtest < /dev/null469 ippjython loader.py $debug -test $forcedwarpqueuename once -simtest < /dev/null 465 470 if ($status) exit 466 471 endif … … 505 510 echo "2000-01-01 00:00:00.0 " >> forcedobjectbatch.dat # trange_start 506 511 echo "2020-01-01 00:00:00.0 " >> forcedobjectbatch.dat # trange_end 507 ippjython queue.py -test edit once -simtest < forcedobjectbatch.dat512 ippjython queue.py $debug -test edit once -simtest < forcedobjectbatch.dat 508 513 if ($status) exit 509 514 endif … … 515 520 rm -rf $OUTDIR/LO 516 521 517 ippjython loader.py -test $forcedobjqueuename once -simtest < /dev/null518 if ($status) exit 519 endif 520 522 ippjython loader.py $debug -test $forcedobjqueuename once -simtest < /dev/null 523 if ($status) exit 524 endif 525 -
trunk/ippToPsps/test/mkgpc1data.dvo
r38974 r38990 194 194 end 195 195 196 echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 197 exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 196 if ($SMALLTEST) 197 echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 198 exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 199 else 200 echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 201 exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 202 end 198 203 199 204 if ($PARALLEL) … … 254 259 end 255 260 256 # echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 257 # exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 258 259 echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 260 exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 261 if ($SMALLTEST) 262 echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 263 exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 264 else 265 echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 266 exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 267 end 261 268 262 269 if ($PARALLEL) … … 323 330 end 324 331 325 echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 326 exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 332 if ($SMALLTEST) 333 echo relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 334 exec relphot -D CATDIR $catdir -region 8 12 18 22 -averages -update 335 else 336 echo relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 337 exec relphot -D CATDIR $catdir -region 8 12 18 22 -images g,r,i,z,y -update 338 end 327 339 328 340 echo dvolens -D CATDIR $catdir -region 8 12 18 22 -update-objects -update
Note:
See TracChangeset
for help on using the changeset viewer.
