Changeset 35352
- Timestamp:
- Apr 3, 2013, 12:52:33 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307/ippToPsps
- Files:
-
- 18 edited
-
config/settings.xml (modified) (3 diffs)
-
jython/batch.py (modified) (4 diffs)
-
jython/config.py (modified) (4 diffs)
-
jython/detectionbatch.py (modified) (7 diffs)
-
jython/dvo.py (modified) (4 diffs)
-
jython/fits.py (modified) (2 diffs)
-
jython/gpc1db.py (modified) (3 diffs)
-
jython/ipptopsps.py (modified) (3 diffs)
-
jython/loader.py (modified) (1 diff)
-
jython/mysql.py (modified) (1 diff)
-
jython/objectbatch.py (modified) (1 diff)
-
jython/pslogger.py (modified) (1 diff)
-
jython/queue.py (modified) (2 diffs)
-
jython/scratchdb.py (modified) (5 diffs)
-
jython/skychunk.py (modified) (1 diff)
-
jython/stackbatch.py (modified) (2 diffs)
-
test/fulltest.sh (modified) (11 diffs)
-
test/mkgpc1data.dvo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/ippToPsps/config/settings.xml
r35217 r35352 49 49 50 50 <!-- GPC1 Db section (REAL version) --> 51 <!-- this db is used for real processing, or in a test if -realgpc 52 is supplied on the cmd line --> 51 53 <gpc1database> 52 54 <name>gpc1</name> … … 86 88 </localdatabase_test> 87 89 88 <!-- GPC1 Db section (REAL VERSION) --> 89 <gpc1database_test> 90 <name>gpc1</name> 91 <host>ippdb01</host> 92 <user>ipp</user> 93 <password>ipp</password> 94 </gpc1database_test> 95 96 <!-- GPC1 Db section (TEST VERSION) 90 <!-- GPC1 Db section (TEST VERSION)--> 91 <!-- this db is used for test processing UNLESS -realgpc is supplied 92 on the cmd line --> 97 93 <gpc1database_test> 98 94 <name>gpc1test</name> … … 100 96 <user>dvo</user> 101 97 <password>dvo</password> 102 </gpc1database_test> -->98 </gpc1database_test> 103 99 104 100 <!-- ippToPsps Db section (TEST VERSION) --> -
branches/eam_branches/ipp-20130307/ippToPsps/jython/batch.py
r35174 r35352 415 415 416 416 # drop any previous tables before import 417 #self.scratchDb.dropTable(table.name)417 self.scratchDb.dropTable(table.name) 418 418 419 419 # IPP FITS files are littered with infinities, so remove these … … 426 426 try: 427 427 table.write(self.scratchDb.url + '#' + table.name) 428 # print "wrote to mysql ", table429 self.scratchDb.killLastConnectionID()428 # XXX this one is not needed 429 # self.scratchDb.killLastConnectionID() 430 430 count = count + 1 431 431 except: … … 454 454 # get everything from table 455 455 try: 456 print "reading table from mysql ", table 456 457 _table = stilts.tread(self.scratchDb.url + '#SELECT * FROM ' + table) 457 458 self.scratchDb.killLastConnectionID() … … 554 555 555 556 if not self.populatePspsTables(): 557 if self.skipBatch: 558 self.ippToPspsDb.updateProcessed(self.batchID, -1) 559 return True 560 556 561 self.logger.errorPair("Aborting this batch", "unable to populate PSPS tables") 557 562 self.ippToPspsDb.updateProcessed(self.batchID, -1) -
branches/eam_branches/ipp-20130307/ippToPsps/jython/config.py
r35217 r35352 28 28 if arg == "-t": 29 29 self.test = True 30 sys.argv.remove(arg) 31 32 self.gpc1test = self.test 33 for arg in sys.argv: 34 if arg == "-realgpc": 35 self.gpc1test = False 30 36 sys.argv.remove(arg) 31 37 … … 62 68 63 69 64 print "config.programName: ", self.programName65 print "config.configDir: ", self.configDir66 print "config.settingsPath: ", self.settingsPath67 print "config.logPath: ", self.logPath68 print "config.test: ", self.test69 print "config.czarPlotsPath: ", self.czarPlotsPath70 # print "config.programName: ", self.programName 71 # print "config.configDir: ", self.configDir 72 # print "config.settingsPath: ", self.settingsPath 73 # print "config.logPath: ", self.logPath 74 # print "config.test: ", self.test 75 # print "config.czarPlotsPath: ", self.czarPlotsPath 70 76 71 77 root = self.settingsDoc.getroot() … … 128 134 for loaderhost in localdb.findall('loader'): 129 135 name = loaderhost.get('mach') 130 print "name, myhost: ", name, myhost136 # print "name, myhost: ", name, myhost 131 137 if name == myhost: 132 138 self.scratchDbLeaf = loaderhost … … 135 141 for loaderhost in localdb.findall('loader'): 136 142 name = loaderhost.get('mach') 137 print "name, myhost: ", name, myhost143 # print "name, myhost: ", name, myhost 138 144 if name == 'generic': 139 145 self.scratchDbLeaf = loaderhost -
branches/eam_branches/ipp-20130307/ippToPsps/jython/detectionbatch.py
r35171 r35352 212 212 )" 213 213 214 print "frame meta sql: ", sql214 # print "frame meta sql: ", sql 215 215 216 216 self.scratchDb.execute(sql) … … 607 607 WHERE b.imageID = " + str(imageID) + \ 608 608 " INTO OUTFILE '" + dumpFile + "'" 609 print "sql: ", sql 610 self.scratchDb.execute(sql) 609 610 try: self.scratchDb.execute(sql) 611 except: 612 self.logger.info("failed to select data for detectionCalib") 613 self.logger.infoPair("sql: ", sql) 614 raise 611 615 612 616 sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName 613 print "sql: ", sql 614 self.scratchDb.execute(sql) 617 try: self.scratchDb.execute(sql) 618 except: 619 self.logger.info("failed to load data from infile for detectionCalib") 620 self.logger.infoPair("sql: ", sql) 621 raise 615 622 616 623 ''' … … 655 662 656 663 # load corresponding header into memory 657 header = self.fits.findAndReadHeader(extname )664 header = self.fits.findAndReadHeader(extname, self.config.test) 658 665 if not header: 659 self.logger.errorPair("No header found for chip", chipname) 666 # XXX There is no way to check if we SHOULD find a given 667 # chip. We have to accept the absence of the header as 668 # information that the chip is not available. This 669 # message is too verbose, only print in test mode 670 if self.config.test: self.logger.errorPair("No header found for chip", chipname) 660 671 return False 661 672 … … 773 784 # this is a bit crude: if the chip is not present, this test will fail and the chip 774 785 # will be (correctly) skipped. would be better to carry that information explicitly ("chip is missing") 775 if not self.scratchDb.astrometricSolutionOK(chipname): 776 self.logger.info("| %5s | ------------- Bad astrometric solution : rejecting ------------ |" % chipname) 786 787 # XXX keep this in or not? 788 # if not self.scratchDb.astrometricSolutionOK(chipname): 789 # self.logger.info("| %5s | ------------- Bad astrometric solution : rejecting ------------ |" % chipname) 790 # return False 791 792 # does this chip exist in the DVO image table (if NOT, then skip it) 793 if not self.scratchDb.haveThisChip(self.imageIDs[chipname]): 794 self.logger.info("| %5s | ------------- Chip not in DVO : rejecting ------------ |" % chipname) 777 795 return False 796 778 797 self.logger.info("populate stuff "); 779 798 # populate remainder of tables … … 803 822 self.totalNullObjID = self.totalNullObjID + results['NULLOBJID'] 804 823 self.totalDetections = self.totalDetections + rowCount 824 825 fractionKept = float(rowCount) / float(results['ORIGINALTOTAL']) 826 # print "kept ", str(fractionKept), " detections from ", chipname 827 828 if fractionKept < 0.8: 829 # print "Too many rejected detections (", str(fractionKept), ", fail on exposure for", chipname 830 self.logger.infoPair("Too many rejected detections, fail on exposure for", chipname) 831 self.skipBatch = True 832 return False; 833 805 834 #self.logger.info("updated totals") 806 835 # check we have something in this Detection table TODO add this to table above 807 836 if rowCount < 1: 808 self.logger.infoPair("Skipping empty table for chipname", chipname) 837 self.logger.infoPair("Empty table for chip, fail on exposure", chipname) 838 self.skipBatch = True 809 839 return False; 810 840 … … 849 879 850 880 # loop through all OTAs again to update with DVO IDs 881 self.skipBatch = False 851 882 self.validChips = [] 852 883 self.tablesToExport = [] … … 872 903 873 904 if self.populatePspsTablesChip(ota, x, y, results, tables): otaCount = otaCount + 1 905 if self.skipBatch: 906 self.logger.error("fatal problem for exposure, skipping") 907 return False 874 908 875 909 if self.populatePspsTablesChip("Chip", 0, 0, results, tables): otaCount = otaCount + 1 910 911 if self.skipBatch: 912 self.logger.error("fatal problem for exposure, skipping") 913 return False 876 914 877 915 # print totals -
branches/eam_branches/ipp-20130307/ippToPsps/jython/dvo.py
r35223 r35352 591 591 def nativeIngestDetections(self, boxId, boxDim): 592 592 593 # XXX put the chunk below in a separate method594 # blow away existing dvoDetection table595 596 593 # clear the 'ingested' field for all boxes owned by this host 597 594 self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost) … … 607 604 ## raise 608 605 609 # drop detections table 610 self.logger.infoPair("Dropping table", self.scratchDb.dvoDetectionTable) 611 self.scratchDb.dropTable(self.scratchDb.dvoDetectionTable) 612 613 # create detections table 614 self.logger.infoPair("Creating table", self.scratchDb.dvoDetectionTable) 615 sql = "CREATE TABLE " + self.scratchDb.dvoDetectionTable + " LIKE dvoDetection" 616 try: self.scratchDb.execute(sql) 617 except: 618 self.logger.errorPair("Unable to create table", self.scratchDb.dvoDetectionTable) 606 # blow away existing dvoDetection table & re-crate 607 if not self.scratchDb.resetDvoDetectionTable(): 608 self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull") 619 609 return False 620 self.scratchDb.changeEngineToInnoDB(self.scratchDb.dvoDetectionTable)621 622 # add fileID column623 sql = "ALTER TABLE " + self.scratchDb.dvoDetectionTable + " ADD fileID INT NOT NULL"624 try: self.scratchDb.execute(sql)625 except:626 self.logger.errorPair("Unable to add fileID column to ", self.scratchDb.dvoDetectionTable)627 return False628 629 # add an index to the fileID column630 self.scratchDb.createIndex(self.scratchDb.dvoDetectionTable, "fileID")631 610 632 611 # make sure we have an up-to-date Images table … … 665 644 p = Popen(cmd, shell=True, stdout=PIPE) 666 645 p.wait() 646 if p.returncode != 0: 647 self.logger.errorPair("dvopsps failed on ", self.scratchDb.dvoDetectionTable) 648 raise 667 649 668 650 ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding? … … 670 652 self.ippToPspsDb.setIngestedBox(boxId, self.scratchDb.dbHost) 671 653 672 # add fileID column654 # run 'ANALYZE' to get indexes up-to-snuff 673 655 sql = "ANALYZE TABLE " + self.scratchDb.dvoDetectionTable 674 656 try: self.scratchDb.execute(sql) -
branches/eam_branches/ipp-20130307/ippToPsps/jython/fits.py
r35097 r35352 87 87 88 88 2880 is the magic number that the FITS format uses to break up data: extensions always begin on multiples of 2880 bytes 89 90 Note that we may not be able to distinguish the case where a header is expected from one where the absence of a header 91 just tells us that the header is not available. In some cases, we may not want to emit the error message ("not found") 92 93 XXX WOW! this block is reading the entire file to get the header. 94 major inefficiency... I thought the FITS interactions all went 95 through STILTS 89 96 ''' 90 def findAndReadHeader(self, name ):97 def findAndReadHeader(self, name, VERBOSE): 91 98 92 99 found = False … … 114 121 115 122 self.file.seek(origIndex, 0) 116 self.logger.errorPair("Could not read header", name)123 if VERBOSE: self.logger.errorPair("Could not read header", name) 117 124 return 118 125 else: -
branches/eam_branches/ipp-20130307/ippToPsps/jython/gpc1db.py
r35185 r35352 22 22 def __init__(self, logger, config): 23 23 # define database type 24 if (config. test):24 if (config.gpc1test): 25 25 dbType = "gpc1database_test" 26 26 else: … … 104 104 try: 105 105 # XXX EAM : test output 106 self.logger.infoPair("sql for dvo items:", sql)107 106 rs = self.executeQuery(sql) 108 107 while (rs.next()): … … 111 110 except: 112 111 self.logger.exception("Can't query for ids in DVO") 112 self.logger.infoPair("failed sql:", sql) 113 113 return rows 114 114 -
branches/eam_branches/ipp-20130307/ippToPsps/jython/ipptopsps.py
r35177 r35352 55 55 raise 56 56 57 print "check client status" 57 58 self.checkClientStatus() 58 59 … … 142 143 def checkClientStatus(self): 143 144 145 print "update client" 144 146 self.ippToPspsDb.updateClient(self.config.programName, self.HOST, self.PID) 145 147 148 print "check killed" 146 149 if self.ippToPspsDb.isKilled(self.HOST, self.PID): 147 150 self.exitProgram("killed via Db") … … 149 152 # this loop pauses the process if we have no skychunk or we have set it to pause 150 153 firstTimeIn = True 154 print "refresh skychunk" 151 155 while not self.refreshSkychunk() or self.ippToPspsDb.isPaused(self.HOST, self.PID): 152 156 -
branches/eam_branches/ipp-20130307/ippToPsps/jython/loader.py
r35226 r35352 36 36 37 37 if self.skychunk.parallel: 38 print "PARALLEL dvo"38 self.logger.info("using PARALLEL DVO") 39 39 else: 40 print "SERIAL dvo"40 self.logger.info("using SERIAL DVO") 41 41 42 42 # connect to the gpc1 database -
branches/eam_branches/ipp-20130307/ippToPsps/jython/mysql.py
r35222 r35352 48 48 raise 49 49 50 # determine the mysql major version number: 51 sql = "SELECT @@version" 52 53 try: 54 rs = self.executeQuery(sql) 55 rs.first() 56 fullVersion = rs.getString(1) 57 self.version = fullVersion[0:3] 58 59 except: 60 print "failed to get version number" 61 raise 62 63 # print "version number: ", self.version 50 64 self.connected = True 51 65 -
branches/eam_branches/ipp-20130307/ippToPsps/jython/objectbatch.py
r35223 r35352 372 372 self.logger.infoPair("Forcing uniqueness on", "objID in Object table") 373 373 rowCountBefore = self.scratchDb.getRowCount("Object") 374 375 # XXX EAM : note that in mysql versions later than 5.1, this fails 376 # unless the following is called first: 377 # set session old_alter_table=1 378 # follow the command with 379 # set session old_alter_table=0 380 # OF COURSE, this fails for mysql version < 5.5... 381 if self.scratchDb.version > 5.1: 382 self.scratchDb.execute("set session old_alter_table=1") 383 374 384 self.scratchDb.execute("ALTER IGNORE TABLE Object ADD UNIQUE INDEX(objID)") 385 if self.scratchDb.version > 5.1: 386 self.scratchDb.execute("set session old_alter_table=0") 387 375 388 rowCountAfter = self.scratchDb.getRowCount("Object") 376 389 self.logger.infoPair("Number of duplicated objIDs removed", "%d out of %d" % ((rowCountBefore - rowCountAfter), rowCountBefore)) -
branches/eam_branches/ipp-20130307/ippToPsps/jython/pslogger.py
r35097 r35352 13 13 def setup(self, programName, basePath, skychunkName, host, pid, stdout=1, sendToFile=0): 14 14 15 formatter = logging.Formatter('%(asctime)s | %(levelname)7s | %(message)s', '%Y-%m-%d %H:%M:%S')15 formatter = logging.Formatter('%(asctime)s.%(msecs)03d | %(levelname)7s | %(message)s', '%Y-%m-%d %H:%M:%S') 16 16 self.setLevel(logging.INFO) 17 17 -
branches/eam_branches/ipp-20130307/ippToPsps/jython/queue.py
r35226 r35352 29 29 super(Queue, self).__init__(argv) 30 30 31 print "inited ipptopsps"31 # print "inited ipptopsps" 32 32 33 33 # create various objects 34 34 self.gpc1Db = Gpc1Db(self.logger, self.config) 35 print "connect to gpc1"35 # print "connect to gpc1" 36 36 37 37 self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb) 38 38 39 print "made datastore"39 # print "made datastore" 40 40 41 41 # connect to scratch database 42 42 self.scratchDb = ScratchDb(self.logger, self.config) 43 43 44 print "connect to scratchdb"44 # print "connect to scratchdb" 45 45 46 46 try: … … 50 50 raise 51 51 52 print "got objects"52 # print "got objects" 53 53 54 54 self.skychunk.printAll() -
branches/eam_branches/ipp-20130307/ippToPsps/jython/scratchdb.py
r35226 r35352 29 29 dbType = "localdatabase" 30 30 31 print "trying to connect: ", dbType31 # print "trying to connect: ", dbType 32 32 33 33 dbName = config.getDbName(dbType) … … 368 368 369 369 ''' 370 Checks whether the given chipID is in the DVO Image table 371 ''' 372 def haveThisChip(self, imageID): 373 374 sql = "SELECT IMAGE_ID FROM " + self.dvoImagesTable + " WHERE IMAGE_ID = " + str(imageID) 375 376 try: 377 rs = self.executeQuery(sql) 378 rs.first() 379 if rs.getInt(1) == int(imageID): 380 # print "DVO has imageID ", imageID 381 return True 382 else: 383 print "DVO lacks imageID ", imageID 384 print "result was ", rs.getInt(1) 385 print "sql: ", sql 386 return False 387 except: 388 print "DVO imageID query failed ", imageID 389 print "sql: ", sql 390 return False 391 392 return True 393 394 ''' 370 395 Creates a table for for ID matching 371 396 ''' … … 409 434 objID BIGINT, \ 410 435 flags INT, \ 411 zp REAL, \412 zpErr REAL, \413 airMass REAL, \414 expTime REAL, \415 ra FLOAT, \416 dec_ FLOAT, \417 raErr REAL, \418 decErr REAL, \436 zp FLOAT, \ 437 zpErr FLOAT, \ 438 airMass FLOAT, \ 439 expTime FLOAT, \ 440 ra DOUBLE, \ 441 dec_ DOUBLE, \ 442 raErr FLOAT, \ 443 decErr FLOAT, \ 419 444 PRIMARY KEY (imageID, ippDetectID), \ 420 445 KEY (objID, detectID) \ … … 463 488 Drops and recreates tables necessary for dvoToMySQL program. Be very careful before using this... 464 489 ''' 490 def resetDvoDetectionTable(self): 491 492 self.logger.infoPair("Dropping table", self.dvoDetectionTable) 493 self.dropTable(self.dvoDetectionTable) 494 495 # create detections table 496 self.logger.infoPair("Creating table", self.dvoDetectionTable) 497 sql = "CREATE TABLE " + self.dvoDetectionTable + " LIKE dvoDetection" 498 try: self.execute(sql) 499 except: 500 self.logger.errorPair("Unable to create table", self.dvoDetectionTable) 501 return False 502 503 # XXX changing the dvoDetectionFull table to MEMORY 504 # self.changeEngineToInnoDB(self.dvoDetectionTable) 505 506 # set engine to memory 507 sql = "ALTER TABLE " + self.dvoDetectionTable + " ENGINE = MEMORY" 508 try: self.execute(sql) 509 except: 510 self.logger.errorPair("Unable to set engine to MEMORY for ", self.dvoDetectionTable) 511 return False 512 513 return True 514 515 ''' 516 Drops and recreates tables necessary for dvoToMySQL program. Be very careful before using this... 517 ''' 465 518 def resetAllDvoTables(self): 466 519 … … 485 538 self.changeEngineToInnoDB(self.dvoDoneTable) 486 539 487 # create detections table 488 self.logger.infoPair("Creating table", self.dvoDetectionTable) 489 sql = "CREATE TABLE " + self.dvoDetectionTable + " LIKE dvoDetection" 490 try: self.execute(sql) 491 except: 492 self.logger.errorPair("Unable to create table", self.dvoDetectionTable) 540 # blow away existing dvoDetection table & re-crate 541 if not self.resetDvoDetectionTable(): 542 self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull") 493 543 return False 494 self.changeEngineToInnoDB(self.dvoDetectionTable)495 496 # add fileID column497 sql = "ALTER TABLE " + self.dvoDetectionTable + " ADD fileID INT NOT NULL"498 try: self.execute(sql)499 except:500 self.logger.errorPair("Unable to add fileID column to ", self.dvoDetectionTable)501 return False502 503 # add an index to the fileID column504 self.createIndex(self.dvoDetectionTable, "fileID")505 506 # XXX : this should be based on choice of useStilts (which is set in dvo.py and must be moved)507 if (False):508 # now add a delete cascading foreign key constraint on fileID509 sql = "ALTER TABLE dvoDetectionFull \510 ADD CONSTRAINT fk_fileID \511 FOREIGN KEY (fileID) \512 REFERENCES dvoDone(id) \513 ON DELETE CASCADE"514 try: self.execute(sql)515 except:516 self.logger.errorPair("Unable to create foreign key on", self.dvoDoneTable)517 return False518 544 519 545 return True -
branches/eam_branches/ipp-20130307/ippToPsps/jython/skychunk.py
r35179 r35352 28 28 if self.name == "all": self.rotateSkychunks = True 29 29 30 print "name: ", self.name31 print "new: ", self.createNewSkychunk32 print "all: ", self.rotateSkychunks30 # print "name: ", self.name 31 # print "new: ", self.createNewSkychunk 32 # print "all: ", self.rotateSkychunks 33 33 34 34 self.logger = logger -
branches/eam_branches/ipp-20130307/ippToPsps/jython/stackbatch.py
r35222 r35352 543 543 # response = raw_input("updated dvo ") 544 544 545 # XXX EAM : note that in mysql versions later than 5.1, this fails 546 # unless the following is called first: 547 # set session old_alter_table=1 548 # follow the command with 549 # set session old_alter_table=0 550 # OF COURSE, this fails for mysql version < 5.5... 551 if self.scratchDb.version > 5.1: 552 self.scratchDb.execute("set session old_alter_table=1") 553 545 554 sql = "ALTER IGNORE TABLE StackDetection ADD PRIMARY KEY (objID)" 546 555 556 if self.scratchDb.version > 5.1: 557 self.scratchDb.execute("set session old_alter_table=0") 558 547 559 self.scratchDb.execute(sql) 548 560 # response = raw_input("add primary key? ") … … 806 818 ON (a.stackDetectID = b.detectID) where b.imageID = " + str(imageID) + \ 807 819 " INTO OUTFILE '" + dumpFile + "'" 808 print "sql: ", sql 809 self.scratchDb.execute(sql) 820 821 try: self.scratchDb.execute(sql) 822 except: 823 self.logger.info("failed to select data for stackDetectionCalib") 824 self.logger.infoPair("sql: ", sql) 825 raise 810 826 811 827 sql = "LOAD DATA INFILE '" + dumpFile + "' INTO TABLE " + tableName 812 print "sql: ", sql 813 self.scratchDb.execute(sql) 828 try: self.scratchDb.execute(sql) 829 except: 830 self.logger.info("failed to load data from infile for stackDetectionCalib") 831 self.logger.infoPair("sql: ", sql) 832 raise 814 833 815 834 ## XXX write this with the select/insert -
branches/eam_branches/ipp-20130307/ippToPsps/test/fulltest.sh
r35225 r35352 1 1 #!/bin/csh -f 2 3 set stackqueuename = 04 if ($#argv > 0) then5 set stackqueuename = $16 echo "stackqueue: $stackqueuename"7 endif8 9 set objectqueuename = 010 if ($#argv > 0) then11 set stackqueuename = $112 echo "stackqueue: $stackqueuename"13 endif14 2 15 3 # a bit crude : get the datadir path by interpollation of the PATH element for psconfig … … 24 12 # before running this test, you must have a mysql user: 25 13 # mkgpc1.sh user localhost eam eam 26 27 14 set mkgpc1 = 1 28 15 set initdb = 1 29 16 set initscratch = 1 17 set initbatch = 1 30 18 set camqueue = 1 31 set initbatch = 132 19 set cambatch = 1 33 20 set stackqueue = 1 … … 36 23 set objectbatch = 1 37 24 25 set args = "" 26 27 while ("$1" != "") 28 switch ("$1") 29 case -mkgpc1 30 set mkgpc1 = 0 31 breaksw; 32 case -initdb 33 set initdb = 0 34 breaksw; 35 case -initscratch 36 set initscratch = 0 37 breaksw; 38 case -initbatch 39 set initbatch = 0 40 breaksw; 41 case -camera 42 set camqueue = 0 43 set cambatch = 0 44 breaksw; 45 case -stack 46 set stackqueue = 0 47 set stackbatch = 0 48 breaksw; 49 case -object 50 set objectqueue = 0 51 set objectbatch = 0 52 breaksw; 53 default: 54 set args=($args $1); 55 breaksw; 56 endsw 57 shift 58 end 59 60 set stackqueuename = 0 61 set objectqueuename = 0 62 38 63 set OUTDIR = "testdata" 39 64 set queuename = "test" 40 65 41 66 if ($mkgpc1) then 67 echo "" 68 echo " ---- mkgpc1data.dvo : creating the dvo & gpc1 database entries ----" 42 69 mkgpc1data.dvo 43 70 endif … … 45 72 # create the ipptopsps database 46 73 if ($initdb) then 74 echo "" 75 echo " ---- init ipptopsps_test ----" 47 76 48 77 # does the database already exist? … … 55 84 # re-create the ipptopsps database 56 85 if ($initscratch) then 86 echo "" 87 echo " ---- init ipptopsps_test_scratch ----" 57 88 58 89 # create the database (ignore failure if it already exists) … … 62 93 endif 63 94 95 # this is poor : we need to queue something in order to generate an init batch 96 # this is because a skychunk carries the info about the datastore used to publish 97 # the batch 98 if ($initbatch) then 99 echo "" 100 echo " ---- make skychunk for IN batches ----" 101 102 ippjython queue.py -test edit <<EOF 103 initbatch 104 test_ds 105 IPP_PSPS 106 0 107 none 108 none 109 0 110 0 111 0 112 0 113 2 114 none 115 0 116 0 117 1 118 1 119 2012-12-10 00:00:00.0 120 3PI 121 3PI 122 0 123 0 124 0 125 1 126 0 127 y 128 y 129 EOF 130 endif 131 132 echo "" 133 echo " ---- create init batch ----" 134 135 rm -rf $OUTDIR/IN 136 ippjython loader.py -test initbatch init 137 endif 138 64 139 # this code is sensitive to a previously existing database? 65 140 if ($camqueue) then 141 echo "" 142 echo " ---- queue P2 batches ----" 143 66 144 ippjython queue.py -test edit <<EOF 67 145 $queuename … … 94 172 endif 95 173 96 if ($initbatch) then97 rm -rf $OUTDIR/IN98 ippjython loader.py -test $queuename init99 endif100 101 174 if ($cambatch) then 175 echo "" 176 echo " ---- load P2 batches ----" 177 102 178 rm -rf $OUTDIR/P2 103 179 ippjython loader.py -test $queuename once … … 106 182 # this code is sensitive to a previously existing database? 107 183 if ($stackqueue) then 184 echo "" 185 echo " ---- queue ST batches ----" 186 108 187 if ($stackqueuename == 0) then 109 188 set stackqueuename = $queuename\_stk … … 140 219 141 220 if ($stackbatch) then 221 echo "" 222 echo " ---- load ST batches ----" 223 142 224 if ($stackqueuename == 0) then 143 225 set stackqueuename = $queuename\_stk … … 149 231 # this code is sensitive to a previously existing database? 150 232 if ($objectqueue) then 233 echo "" 234 echo " ---- queue OB batches ----" 235 151 236 if ($objectqueuename == 0) then 152 237 set objectqueuename = $queuename\_obj … … 183 268 184 269 if ($objectbatch) then 270 echo "" 271 echo " ---- load OB batches ----" 272 185 273 if ($objectqueuename == 0) then 186 274 set objectqueuename = $queuename\_obj -
branches/eam_branches/ipp-20130307/ippToPsps/test/mkgpc1data.dvo
r35188 r35352 196 196 # PCA2X0Y2 197 197 198 if ($i == 3) 199 echo "NOTE: not adding image $i to DVO : this simulates images with poor astrometry" 200 continue 201 end 202 198 203 echo addstar -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass 199 204 exec addstar -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass
Note:
See TracChangeset
for help on using the changeset viewer.
