Changeset 32852
- Timestamp:
- Dec 2, 2011, 11:45:13 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20111122
- Files:
-
- 22 edited
- 3 copied
-
dbconfig/add.md (modified) (1 diff)
-
dbconfig/changes.txt (modified) (1 diff)
-
dbconfig/pstamp.md (modified) (1 diff)
-
ippToPsps/jython/batch.py (modified) (7 diffs)
-
ippToPsps/jython/configs/newsas.xml (copied) (copied from trunk/ippToPsps/jython/configs/newsas.xml )
-
ippToPsps/jython/configs/oldthreepi.xml (modified) (1 diff)
-
ippToPsps/jython/czardb.py (copied) (copied from trunk/ippToPsps/jython/czardb.py )
-
ippToPsps/jython/datastore.py (modified) (1 diff)
-
ippToPsps/jython/datastoreDupeChecker.sh (copied) (copied from trunk/ippToPsps/jython/datastoreDupeChecker.sh )
-
ippToPsps/jython/gpc1db.py (modified) (1 diff)
-
ippToPsps/jython/ipptopspsdb.py (modified) (6 diffs)
-
ippToPsps/jython/metrics.py (modified) (6 diffs)
-
ippToPsps/jython/odm.py (modified) (1 diff)
-
ippToPsps/jython/republishbatch.py (modified) (2 diffs)
-
ippToPsps/xmlschema/BatchManifest.xsd (modified) (1 diff)
-
ppSub/src/ppSubFlagNeighbors.c (modified) (5 diffs)
-
ppSub/src/ppSubReadoutPhotometry.c (modified) (1 diff)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (1 diff)
-
pstamp/scripts/pstamp_cleanup.pl (modified) (2 diffs)
-
pstamp/scripts/pstamp_get_image_job.pl (modified) (7 diffs)
-
pstamp/scripts/pstamp_job_run.pl (modified) (2 diffs)
-
pstamp/scripts/pstamp_parser_run.pl (modified) (1 diff)
-
psvideophot (modified) (1 prop)
-
psvideophot/src (modified) (1 prop)
-
psvideophot/src/psvideoLoop.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/dbconfig/add.md
r31378 r32852 3 3 add_id S64 0 # Primary Key AUTO_INCREMENT 4 4 stage STR 64 # what the stage is (warp, cam, diff, 5 stage_id S64 0 # Key INDEX(add_id,cam_id) fkey(cam_id) ref camRun(cam_id) 5 stage_id S64 0 # Key INDEX(add_id,cam_id) fkey(cam_id) ref camRun(cam_id) 6 stage_extra1 S32 0 6 7 state STR 64 # Key 7 8 workdir STR 255 -
branches/eam_branches/ipp-20111122/dbconfig/changes.txt
r32609 r32852 2177 2177 2178 2178 UPDATE dbversion set schema_version = '1.1.71', updated= CURRENT_TIMESTAMP(); 2179 2180 2181 -- this is to stuff extra stage related information. 2182 -- example - multi filter staticsky stage - this allows selection of 2183 -- each filter of cmf staticsky. 2184 2185 alter table addRun add column stage_extra1 int after stage_id; -
branches/eam_branches/ipp-20111122/dbconfig/pstamp.md
r30314 r32852 67 67 num S64 0 # Primary Key AUTO_INCREMENT 68 68 END 69 70 pstampFile METADATA 71 file_id S64 0 # Primary Key AUTO_INCREMENT 72 job_id S64 0 73 path STR 255 74 end -
branches/eam_branches/ipp-20111122/ippToPsps/jython/batch.py
r32596 r32852 286 286 Publishes this batch to the datastore 287 287 ''' 288 def tar ZipAndpublishToDatastore(self):288 def tarAndZip(self): 289 289 290 290 # set up filenams and paths … … 295 295 296 296 # tar directory 297 p = Popen("tar -cvf " + tarPath + "\298 -C " + self.subDir + " \299 " + self.batchName, shell=True, stdout=PIPE)297 cmd = "tar -cvf " + tarPath + " -C " + self.subDir + " " + self.batchName 298 self.logger.infoPair("Creating tar archive", cmd) 299 p = Popen(cmd, shell=True, stdout=PIPE) 300 300 p.wait() 301 301 302 if p.returncode != 0: 303 self.logger.errorPair("tar command", "failed") 304 return False 305 302 306 # zip tar archive 303 p = Popen("gzip -c " + tarPath + " > " + tarballPath, shell=True, stdout=PIPE) 307 cmd = "gzip -c " + tarPath + " > " + tarballPath 308 self.logger.infoPair("Compressing tar archive", cmd) 309 p = Popen(cmd, shell=True, stdout=PIPE) 304 310 p.wait() 311 312 if p.returncode != 0: 313 self.logger.errorPair("gzip command", "failed") 314 return False 315 316 # only now can we report that the batch has successfully processed 317 self.ippToPspsDb.updateProcessed(self.batchID, 1) 305 318 306 319 # delete tar file and original directory … … 308 321 shutil.rmtree(self.localOutPath) 309 322 310 # now publish to the datastore 311 Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile) 323 return True 312 324 313 325 ''' … … 448 460 try: 449 461 stilts.twrites(_tables, self.outputFitsPath, fmt='fits') 450 self.ippToPspsDb.updateProcessed(self.batchID, 1)451 462 except: 452 463 self.logger.exception("Could not write to FITS") … … 494 505 p = Popen(cmd, shell=True, stdout=PIPE) 495 506 p.wait() 496 # out = p.stdout.read()497 507 498 508 rowCount = self.scratchDb.getRowCount("dvoDetection") … … 507 517 ''' 508 518 Creates and publishes a batch 509 TODO all meth dds call below should throw exceptions on failure519 TODO all methods call below should throw exceptions on failure 510 520 ''' 511 521 def run(self): … … 530 540 else: 531 541 self.writeBatchManifest() 532 if int(self.doc.find("options/publishToDatastore").text): self.tarZipAndpublishToDatastore() 542 if int(self.doc.find("options/publishToDatastore").text): 543 # tar and zip ready for publication to datastore 544 if self.tarAndZip(): 545 # now publish to the datastore 546 tarballFile = Batch.getTarballFile(self.batchID) 547 Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile) 548 533 549 if int(self.doc.find("options/reportNulls").text): self.reportNullsInAllPspsTables(False) 534 550 -
branches/eam_branches/ipp-20111122/ippToPsps/jython/configs/oldthreepi.xml
r32736 r32852 48 48 <gpc1Label>ThreePi.V3</gpc1Label> 49 49 <location>/data/ipp005.0/gpc1/catdirs/ThreePi.V3</location> 50 <minRA>1 35</minRA>50 <minRA>105</minRA> 51 51 <maxRA>270</maxRA> 52 52 <minDec>-100</minDec> -
branches/eam_branches/ipp-20111122/ippToPsps/jython/datastore.py
r32491 r32852 48 48 # build dsreg command 49 49 command = "dsreg --add " + name + "\ 50 -- copy--datapath " + path + "\50 --link --datapath " + path + "\ 51 51 --type " + self.type + "\ 52 52 --product " + self.product + "\ -
branches/eam_branches/ipp-20111122/ippToPsps/jython/gpc1db.py
r32493 r32852 30 30 self.logger.debug("Gpc1Db destructor") 31 31 32 33 '''34 TODO35 '''36 def getIDsInThisDVODbForThisStageFudge(self):37 38 sql = "SELECT staticskyRun.sky_id \39 FROM staticskyInput, staticskyRun, stackRun, staticskyResult \40 WHERE staticskyRun.sky_id = staticskyInput.sky_id \41 AND staticskyInput.stack_id = stackRun.stack_id \42 AND staticskyInput.sky_id = staticskyResult.sky_id \43 AND staticskyRun.label like 'MD04.staticsky' \44 AND stackRun.filter like 'i%'"45 46 try:47 rs = self.executeQuery(sql)48 except:49 self.logger.exception("Can't query for ids in DVO")50 51 ids = []52 while (rs.next()):53 ids.append(rs.getInt(1))54 55 rs.close()56 57 self.logger.debug("Found %d items in DVO database '" % (len(ids)))58 59 return ids60 32 61 33 ''' -
branches/eam_branches/ipp-20111122/ippToPsps/jython/ipptopspsdb.py
r32654 r32852 103 103 ''' 104 104 Returns a list of processed batch IDs that are not loaded to the datastore 105 NB we have a date constraint here because, before this time, it is possible that 106 a test batch would be labelled as processed but not loaded to datastore, and we would NOT 107 want to load a test batch to PSPS 108 109 We also check that these batches are more than 4 HOURs old, so that we don't attempt to 110 publish something simulataneously with the client that it producing it 105 111 ''' 106 112 def getProcessedButFailedDatastoreBatchIDs(self, epoch, dvoGpc1Label, batchType): … … 112 118 AND dvo_db = '" + dvoGpc1Label + "' \ 113 119 AND processed = 1\ 114 AND loaded_to_datastore = -1" 120 AND loaded_to_datastore != 1 \ 121 AND timestamp > '2011-10-27' \ 122 AND timestamp < now() - INTERVAL 4 HOUR" 115 123 116 124 ids = [] … … 466 474 AND batch_type = '" + batchType + "' \ 467 475 AND dvo_db = '" + dvoGpc1Label + "' \ 468 AND timestamp BETWEEN now() - INTERVAL 2HOUR AND now()"476 AND timestamp BETWEEN now() - INTERVAL 4 HOUR AND now()" 469 477 470 478 try: … … 499 507 500 508 ''' 501 Have we already processed and published this batch?509 Have we already processed this stage_id? 502 510 ''' 503 511 def alreadyProcessed(self, batchType, stage_id, epoch, dvoGpc1Label): … … 509 517 AND timestamp > '" + epoch + "' \ 510 518 AND dvo_db = '" + dvoGpc1Label + "' \ 511 AND processed = 1 \ 512 AND loaded_to_datastore != 0" 519 AND processed = 1" 513 520 514 521 try: … … 655 662 self.execute(sql) 656 663 664 ''' 665 Resets a batch ready for re-loading to the datastore 666 ''' 667 def resetBatch(self, batchID): 668 669 sql = "UPDATE batch SET \ 670 loaded_to_datastore = 0, \ 671 loaded_to_ODM = 0, \ 672 deleted_datastore = 0, \ 673 deleted_dxlayer = 0, \ 674 comment = 'This batch was reset, ready for re-load to datastore' \ 675 WHERE batch_id = " + str(batchID) 676 677 self.execute(sql) 657 678 658 679 ''' -
branches/eam_branches/ipp-20111122/ippToPsps/jython/metrics.py
r32587 r32852 1 1 import math 2 import time 2 3 import logging 3 4 import smtplib … … 10 11 from pslogger import PSLogger 11 12 from ipptopspsdb import IppToPspsDb 13 from czardb import CzarDb 12 14 from gpc1db import Gpc1Db 13 15 … … 76 78 numPending = len(pending) 77 79 78 #if stage == ' merge_worthy' and batchType == "P2":79 # for n in pending: print n80 #if stage == 'loaded_to_datastore' and batchType == "P2": 81 # for n in fail: print n 80 82 81 83 str = "\033[1;34m%5s\033[1;m \033[1;32m%5s\033[1;m \033[1;31m%5s\033[1;m " % (getIntAsString(numPending), getIntAsString(numSuccess), getIntAsString(numFail)) … … 84 86 prevList = success 85 87 print >> DATFILE, stage, numSuccess, numFail, numPending 88 89 czarDb.insertStats(stage, DVOLABEL, batchType, numPending, numSuccess, numFail) 86 90 87 91 if stage == 'processed': numPendingProcessed = numPending … … 124 128 if len(sys.argv) > 1: CONFIG = sys.argv[1] 125 129 else: 126 print "** Usage: " + sys.argv[0] + " <configPath> "130 print "** Usage: " + sys.argv[0] + " <configPath> [hours]" 127 131 sys.exit(1) 128 132 129 now = datetime.datetime.now() 133 if len(sys.argv) > 2: 134 HOURS = float(sys.argv[2]) 135 SECONDS = HOURS * 60.0 * 60.0 136 else: 137 SECONDS = None 138 139 130 140 131 141 # open config file … … 136 146 logger.setup(configDoc, "metrics") 137 147 148 # create database objects 138 149 ippToPspsDb = IppToPspsDb(logger, configDoc) 150 czarDb = CzarDb(logger, configDoc) 139 151 gpc1Db = Gpc1Db(logger, configDoc) 140 141 MINRA = None142 MAXRA = None143 MINDEC = None144 MAXDEC = None145 152 146 153 DVOLABEL = configDoc.find("dvo/gpc1Label").text 147 154 EPOCH = configDoc.find("options/epoch").text 148 155 149 logger.infoTitle("ippToPsps loading summary") 150 logger.infoPair("Time now", now.strftime("%Y-%m-%d %H:%M:%S")) 151 logger.infoPair("Loading epoch", EPOCH) 152 logger.infoPair("DVO label", DVOLABEL) 153 154 try: 155 MINRA = float(configDoc.find("dvo/minRA").text) 156 MAXRA = float(configDoc.find("dvo/maxRA").text) 157 MINDEC = float(configDoc.find("dvo/minDec").text) 158 MAXDEC = float(configDoc.find("dvo/maxDec").text) 159 logger.infoPair("Coordinates", "%.1f to %.1f RA, %.1f to %.1f Dec" % (MINRA, MAXRA, MINDEC, MAXDEC)) 160 except: 161 pass 156 while True: 157 158 logger.infoTitle("ippToPsps loading summary") 159 now = datetime.datetime.now() 160 logger.infoPair("Time now", now.strftime("%Y-%m-%d %H:%M:%S")) 161 logger.infoPair("Loading epoch", EPOCH) 162 logger.infoPair("DVO label", DVOLABEL) 163 164 # get equatorial coord constraints, if any 165 MINRA = None 166 MAXRA = None 167 MINDEC = None 168 MAXDEC = None 169 170 try: 171 MINRA = float(configDoc.find("dvo/minRA").text) 172 MAXRA = float(configDoc.find("dvo/maxRA").text) 173 MINDEC = float(configDoc.find("dvo/minDec").text) 174 MAXDEC = float(configDoc.find("dvo/maxDec").text) 175 logger.infoPair("Coordinates", "%.1f to %.1f RA, %.1f to %.1f Dec" % (MINRA, MAXRA, MINDEC, MAXDEC)) 176 except: 177 pass 162 178 163 179 164 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 165 logger.info("|Type| batches per hour | last 24 hours | per day this week | total detections | last published |") 166 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 167 rateP2 = printStats("P2") 168 rateST = printStats("ST") 169 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 170 171 logger.info("") 172 173 stages = ippToPspsDb.getStages() 174 colCount = len(stages) 175 writetableSeparator(colCount) 176 sys.stdout.write("|Type| DVO ") 177 for stage in stages: sys.stdout.write("|%19s" % stage) 178 sys.stdout.write("|\n") 179 sys.stdout.write("| | ") 180 for stage in stages: sys.stdout.write("| Pend Succ Fail ") 181 sys.stdout.write("|\n") 182 writetableSeparator(colCount) 183 pendP2Processed = printTableRow(stages, "P2") 184 pendSTProcessed = printTableRow(stages, "ST") 185 writetableSeparator(colCount) 186 187 logger.info("") 188 try: logger.infoPair("Estimated time for P2s", "%.1f hours" % (pendP2Processed / rateP2)) 189 except: pass 190 try: logger.infoPair("Estimated time for STs", "%.1f hours" % (pendSTProcessed / rateST)) 191 except: pass 180 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 181 logger.info("|Type| batches per hour | last 24 hours | per day this week | total detections | last published |") 182 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 183 rateP2 = printStats("P2") 184 rateST = printStats("ST") 185 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 186 187 logger.info("") 188 189 stages = ippToPspsDb.getStages() 190 colCount = len(stages) 191 writetableSeparator(colCount) 192 sys.stdout.write("|Type| DVO ") 193 194 for stage in stages: sys.stdout.write("|%19s" % stage) 195 sys.stdout.write("|\n") 196 sys.stdout.write("| | ") 197 for stage in stages: sys.stdout.write("| Pend Succ Fail ") 198 sys.stdout.write("|\n") 199 writetableSeparator(colCount) 200 pendP2Processed = printTableRow(stages, "P2") 201 pendSTProcessed = printTableRow(stages, "ST") 202 writetableSeparator(colCount) 203 204 logger.info("") 205 try: logger.infoPair("Estimated time for P2s", "%.1f hours" % (pendP2Processed / rateP2)) 206 except: pass 207 try: logger.infoPair("Estimated time for STs", "%.1f hours" % (pendSTProcessed / rateST)) 208 except: pass 209 210 if SECONDS: 211 logger.infoPair("Waiting for", "%f hours" % HOURS) 212 time.sleep(SECONDS) 213 else: break 214 215 -
branches/eam_branches/ipp-20111122/ippToPsps/jython/odm.py
r32540 r32852 67 67 STATE = doc.find("{%s}OdmBatchState/{%s}BatchState" % (NAMESPACE, NAMESPACE)).text 68 68 MESSAGE = doc.find("{%s}OdmBatchState/{%s}Message" % (NAMESPACE, NAMESPACE)).text 69 results['MESSAGE'] = MESSAGE 70 results['DETAILS'] = "None" 69 71 70 72 # we assume that batches 'OnHold' are failed as it is very rare for such -
branches/eam_branches/ipp-20111122/ippToPsps/jython/republishbatch.py
r32497 r32852 11 11 12 12 ''' 13 A program that republishes a bath to the datastore. 13 14 15 It first 'resets' the batch in the ippToPsps database, i.e. pretends it has never been published, then re-publishes it to the datastore 14 16 ''' 15 17 if len(sys.argv) > 2: … … 50 52 logger.infoPair("subdir", subDir) 51 53 logger.infoPair("tarballfile", tarballFile) 54 logger.infoPair("Reseting batch in database", "%d" % BATCHID) 55 ippToPspsDb.resetBatch(BATCHID) 52 56 logger.infoPair("publishing to", DATASTOREPRODUCT) 53 57 Batch.publishToDatastore(datastore, BATCHID, batchName, subDir, tarballFile) -
branches/eam_branches/ipp-20111122/ippToPsps/xmlschema/BatchManifest.xsd
r29075 r32852 51 51 <xs:enumeration value="SSS" /> 52 52 <xs:enumeration value="3PI" /> 53 <xs:enumeration value="STS1" /> 53 <xs:enumeration value="STS" /> 54 <xs:enumeration value="SA1" /> 55 <xs:enumeration value="SA2" /> 56 <xs:enumeration value="SA3" /> 57 <xs:enumeration value="SAS" /> 58 <xs:enumeration value="OLD" /> 54 59 </xs:restriction> 55 60 </xs:simpleType> -
branches/eam_branches/ipp-20111122/ppSub/src/ppSubFlagNeighbors.c
r31449 r32852 18 18 #include "ppSub.h" 19 19 20 # define MIN_ERROR 0.02 /* padding for self-match flux test */ 21 # define MAX_OFFSET 5.0 /* delta mag greater than this is not a self match */ 22 20 23 // match the diff sources to the detections from the positive or negative input images 21 24 // matchRef : false if this is the standard diff image, true if this is the inverse (in-ref vs ref-in) 22 25 // this is needed to choose which value is positive and which is negative relative to the difference 23 bool ppSubFlagNeighbors(pmConfig *config, pmFPAview *view, psArray *sources, bool matchRef) {26 bool ppSubFlagNeighbors(pmConfig *config, pmFPAview *view, psArray *sources, bool subInverse) { 24 27 25 28 bool status; … … 106 109 psAssert ((sourceM1->imageID == 1) || (sourceM1->imageID == 2), "error in pmPhotObj construction (second entry is not from 1 or 2"); 107 110 111 // which image gives the match, the positive or negative one? 112 bool positive = false; 113 if (subInverse) { 114 positive = (sourceM1->imageID == 2); 115 } else { 116 positive = (sourceM1->imageID == 1); 117 } 118 119 // check if source and sourceM1 are likely to be the same flux (ie, isolated detection in one image) 120 if (positive && isfinite(sourceM1->psfMag) && isfinite(source->psfMag)) { 121 float dMag = sourceM1->psfMag - source->psfMag; 122 float nSig = fabs(dMag) / hypot(MIN_ERROR, source->psfMagErr); 123 if (nSig < MAX_OFFSET) { 124 source->mode2 |= PM_SOURCE_MODE2_DIFF_SELF_MATCH; 125 } 126 } 127 108 128 // only one match. set a flag? 109 129 source->mode2 |= PM_SOURCE_MODE2_DIFF_WITH_SINGLE; 110 130 if (source->diffStats) { 111 // which is match need an xor here...112 bool positive = !matchRef && (sourceM1->imageID == 1);113 positive |= matchRef && (sourceM1->imageID == 2);114 131 float SN1 = isfinite(sourceM1->psfMagErr) ? 1.0 / sourceM1->psfMagErr : NAN; 115 132 if (positive) { … … 133 150 psAssert (sourceM1->imageID != sourceM2->imageID, "error in pmPhotObj construction (case 3.3)"); 134 151 152 // we don't know which matched source (sourceM1 or sourceM2) is the positive detection, 153 // and the answer depends on both the ID and the subtraction order (in-ref vs ref-in) 154 // positive is true if sourceM1 is the positive detection 155 bool positive = false; 156 if (subInverse) { 157 positive = (sourceM1->imageID == 2); 158 } else { 159 positive = (sourceM1->imageID == 1); 160 } 161 162 // check for self-detection 163 float magPSF1 = positive ? sourceM1->psfMag : sourceM2->psfMag; 164 if (isfinite(magPSF1) && isfinite(source->psfMag)) { 165 float dMag = magPSF1 - source->psfMag; 166 float nSig = fabs(dMag) / hypot(MIN_ERROR, source->psfMagErr); 167 if (nSig < MAX_OFFSET) { 168 source->mode2 |= PM_SOURCE_MODE2_DIFF_SELF_MATCH; 169 } 170 } 171 135 172 source->mode2 |= PM_SOURCE_MODE2_DIFF_WITH_DOUBLE; 136 173 if (source->diffStats) { 137 // which is match need an xor here...138 bool positive = !matchRef && (sourceM1->imageID == 1);139 positive |= matchRef && (sourceM1->imageID == 2);140 174 float SN1 = isfinite(sourceM1->psfMagErr) ? 1.0 / sourceM1->psfMagErr : NAN; 141 175 float SN2 = isfinite(sourceM2->psfMagErr) ? 1.0 / sourceM2->psfMagErr : NAN; … … 187 221 pmPhotObj *obj = objects->data[j]; 188 222 223 // fprintf (stderr, "%f, %f vs %f, %f\n", src->peak->xf, src->peak->yf, obj->x, obj->y); 224 189 225 if (!src) NEXT1; 190 226 if (!src->peak) NEXT1; … … 209 245 src = sources->data[I]; 210 246 211 if (!src) NEXT1;212 if (!src->peak) NEXT1;213 if (!isfinite(src->peak->xf)) NEXT1;214 if (!isfinite(src->peak->yf)) NEXT1;215 if (!isfinite(src->peak->detValue)) NEXT1;216 if (sqrt(src->peak->detValue) < MIN_SN) NEXT1;247 if (!src) continue; 248 if (!src->peak) continue; 249 if (!isfinite(src->peak->xf)) continue; 250 if (!isfinite(src->peak->yf)) continue; 251 if (!isfinite(src->peak->detValue)) continue; 252 if (sqrt(src->peak->detValue) < MIN_SN) continue; 217 253 218 254 dx = src->peak->xf - obj->x; -
branches/eam_branches/ipp-20111122/ppSub/src/ppSubReadoutPhotometry.c
r31449 r32852 92 92 // detections in the wings (or cores) of bright(er) stars found in both images. 93 93 // flag detections based on their distance from the bright(er) input sources. 94 bool matchRef= !strcasecmp(name, "PPSUB.INVERSE");95 ppSubFlagNeighbors (config, view, sources, matchRef);94 bool subInverse = !strcasecmp(name, "PPSUB.INVERSE"); 95 ppSubFlagNeighbors (config, view, sources, subInverse); 96 96 97 97 if (data->stats) { -
branches/eam_branches/ipp-20111122/pstamp/scripts/pstamp_checkdependent.pl
r32364 r32852 255 255 # caller will fault the jobs 256 256 return $error_code; 257 } elsif ($chip->{dsRun_state} eq 'failed_revert') {257 } elsif ($chip->{dsRun_state} =~ /failed_revert/) { 258 258 # XXX: revert failures are rarely fixed. give up but say it's just not available not GONE 259 259 print "magicDSRun.state = $dsRun_state for chipRun $stage_id is in state failed_revert cannot update\n"; -
branches/eam_branches/ipp-20111122/pstamp/scripts/pstamp_cleanup.pl
r27874 r32852 23 23 24 24 use PS::IPP::Config qw( :standard ); 25 use PS::IPP::PStamp::Job qw( :standard ); 25 26 26 27 my $req_id; … … 95 96 } 96 97 98 { 99 my $command = "$pstamptool -listfile -req_id $req_id"; 100 $command .= " -dbname $dbname" if $dbname; 101 $command .= " -dbserver $dbserver" if $dbserver; 102 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 103 run(command => $command, verbose => $verbose); 104 unless ($success) { 105 die("Unable to perform $command error code: $error_code"); 106 } 107 my $output = join "", @$stdout_buf; 108 if ($output) { 109 my $files = parse_md_fast($mdcParser, $output); 110 foreach my $file (@$files) { 111 $ipprc->file_delete($file->{path}); 112 } 113 } 114 } 115 97 116 # now go find the workdir for this request 98 117 # XXX: we finally *have* to store this in the database -
branches/eam_branches/ipp-20111122/pstamp/scripts/pstamp_get_image_job.pl
r30663 r32852 25 25 26 26 my $output_base; 27 my $bundleroot; 27 28 28 29 my $verbose; 29 my $i pprc;30 my $imagedbname; 30 31 my $dbname; 31 32 my $dbserver; … … 41 42 'rownum=s' => \$rownum, 42 43 'output_base=s' => \$output_base, 44 'bundleroot=s' => \$bundleroot, 45 'imagedbname=s' => \$imagedbname, 43 46 'dbname=s' => \$dbname, 44 47 'dbserver=s' => \$dbserver, … … 52 55 53 56 my_die( $err, $PS_EXIT_PROG_ERROR) if $err; 57 58 my $ipprc = PS::IPP::Config->new(); 54 59 55 60 my $params_file = $output_base . ".mdc"; … … 91 96 my $missing_tools; 92 97 my $dist_bundle = can_run('dist_bundle.pl') or (warn "Can't find dist_bundle.pl" and $missing_tools = 1); 98 my $pstamptool = can_run('pstamptool') or (warn "Can't find pstamptool" and $missing_tools = 1); 93 99 if ($missing_tools) { 94 100 warn("Can't find required tools."); … … 96 102 } 97 103 104 $pstamptool .= " -dbname $dbname" if $dbname; 105 $pstamptool .= " -dbserver $dbserver" if $dbserver; 106 98 107 my $outdir = dirname($output_base); 99 108 my $basename = basename($path_base); 100 my $outroot = $output_base ."_" . $basename;101 109 my $results_file = $output_base . ".bundle_results"; 110 my $outroot; 111 if ($bundleroot) { 112 my (undef, undef, undef, $mday, $month, $year) = gmtime(time()); 113 $month += 1; 114 $year += 1900; 115 116 # This will generate an outroot like: 117 # neb://any/pstamp/bundles/2011/11/22/14026916_1_1_o5739g0358o.353654.wrp.215092.skycell.2083.025 118 119 $outroot = $bundleroot . sprintf("/%4d/%02d/%02d/${job_id}_", $year, $month, $mday) . basename($output_base) . "_". $basename; 120 } else { 121 $outroot = $output_base ."_" . $basename; 122 } 102 123 103 124 { … … 105 126 $command .= " --results_file $results_file"; 106 127 $command .= " --component $component --path_base $path_base --outroot $outroot"; 107 # XXX: we need to do some work if we want to support muggle bundles108 # $command .= " --no_magic if $no_magic";128 # XXX: we need to do some work if we want to support muggle bundles 129 # $command .= " --no_magic if $no_magic"; 109 130 $command .= " --magicked" if $magicked; 110 $command .= " --dbname $ dbname" if $dbname;131 $command .= " --dbname $imagedbname" if $imagedbname; 111 132 $command .= " --verbose" if $verbose; 112 133 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 147 168 } 148 169 170 if ($bundleroot) { 171 { 172 # delete any existing pstampFile in case this job has faulted and 173 # been reverted 174 my $command = "$pstamptool -deletefile -job_id $job_id"; 175 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 176 run(command => $command, verbose => $verbose); 177 unless ($success) { 178 my_die("Unable to perform $command: $error_code", $error_code >> 8); 179 } 180 } 181 my $linkname = "$outdir/$file_name"; 182 if (-l $linkname or -e $linkname) { 183 unlink $linkname or my_die("Failed to unlink existing symlink: $linkname", $PS_EXIT_UNKNOWN_ERROR); 184 } 185 my $bundle_name = dirname($outroot) . "/$file_name"; 186 my $resolved = $ipprc->file_resolve($bundle_name); 187 if (!$resolved) { 188 my_die("failed to resolve $bundle_name", $PS_EXIT_UNKNOWN_ERROR); 189 } 190 symlink $resolved, $linkname or my_die("failed to create symlink to $resolved in $outdir", 191 $PS_EXIT_UNKNOWN_ERROR); 192 193 my $command = "$pstamptool -addfile -job_id $job_id -path $bundle_name"; 194 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 195 run(command => $command, verbose => $verbose); 196 unless ($success) { 197 my_die("Unable to perform $command: $error_code", $error_code >> 8); 198 } 199 } 200 201 149 202 print REGLIST "$file_name|$bytes|$md5sum|tgz|\n"; 150 203 -
branches/eam_branches/ipp-20111122/pstamp/scripts/pstamp_job_run.pl
r31508 r32852 88 88 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 89 89 90 my $params = read_params_file($outputBase); 91 90 92 my $jobStatus; 91 93 if ($jobType eq "stamp") { 92 my $params = read_params_file($outputBase);93 94 94 95 my $argString; … … 272 273 } elsif ($jobType eq "get_image") { 273 274 274 my $uri = ""; 275 my $pstamp_bundle_root = metadataLookupStr($ipprc->{_siteConfig}, "PSTAMP_BUNDLE_ROOT"); 276 my $imagedb = $params->{imagedb}; 277 275 278 my $command = "$pstamp_get_image_job --job_id $job_id --output_base $outputBase --rownum $rownum"; 279 $command .= " --bundleroot $pstamp_bundle_root" if $pstamp_bundle_root; 280 $command .= " --imagedb $imagedb" if $imagedb; 276 281 $command .= " --dbname $dbname" if $dbname; 277 282 $command .= " --dbserver $dbserver" if $dbserver; -
branches/eam_branches/ipp-20111122/pstamp/scripts/pstamp_parser_run.pl
r30317 r32852 89 89 # outdir is where all of the files generated for this request are placed 90 90 # NOTE: this location needs to be kept in sync with the web interface ( request.php ) 91 my $datestr = strftime "%Y %m%d", gmtime;91 my $datestr = strftime "%Y/%m/%d", gmtime; 92 92 my $datedir = "$pstamp_workdir/$datestr"; 93 93 if (! -e $datedir ) { 94 mkdir $datedir or my_die( "failed to create working directory $datedir for request id $req_id", $req_id, 95 $PS_EXIT_CONFIG_ERROR); 94 my $rc = system "mkdir -p $datedir"; 95 if ($rc) { 96 my $status = $rc >> 8; 97 $status = $PS_EXIT_CONFIG_ERROR if !$status; 98 my_die( "failed to create working directory $datedir for request id $req_id", $req_id, 99 $status); 100 } 96 101 } 97 102 -
branches/eam_branches/ipp-20111122/psvideophot
- Property svn:mergeinfo changed
/trunk/psvideophot (added) merged: 32787,32791
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20111122/psvideophot/src
- Property svn:ignore
-
branches/eam_branches/ipp-20111122/psvideophot/src/psvideoLoop.c
r32556 r32852 234 234 Centering(readout->image, EDGE, &vpSum, xy, median); 235 235 236 vpFlux = SubSum(readout->image, xy, median); 236 if (isfinite(xy[0]) && isfinite(xy[1])) { 237 vpFlux = SubSum(readout->image, xy, median); 238 } 237 239 238 240 // printf("%4d %9.2f %9.2f %9.2f %.1f %.1f %9.2f\n",
Note:
See TracChangeset
for help on using the changeset viewer.
