Changeset 38744
- Timestamp:
- Sep 16, 2015, 10:13:32 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/resort_catalog.c
r38737 r38744 40 40 resort_catalog_lensing (catalog); 41 41 resort_catalog_starpar (catalog); 42 43 // XXX somehow need to set the value of lensing->measure offset here44 42 } 45 43 … … 85 83 // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't) 86 84 myAssert(average[averageSeq[i]].catID == measure[measureSeq[i]].catID, "object / detection mismatch"); 87 # if (1)88 85 // myAssert(average[averageSeq[i]].objID == measure[measureSeq[i]].objID, "object / detection mismatch"); 89 // check if the objID is correct. if not, check if it is byte-swapped (this has happened) and repair if so. 90 // otherwise, abort86 87 // Check some possible causes for objID failures 91 88 if (average[averageSeq[i]].objID != measure[measureSeq[i]].objID) { 92 89 fprintf (stderr, "object / detection mismatch average.objID = %d, measure.objID = %d, catID: %d, detID: %d", 93 90 average[averageSeq[i]].objID, measure[measureSeq[i]].objID, 94 91 measure[measureSeq[i]].catID, measure[measureSeq[i]].detID); 92 // is the byte-swapped value the correct objID? 95 93 int objIDalt = measure[measureSeq[i]].objID; 96 94 char *byte = (char *) &objIDalt; … … 99 97 tmp = byte[1]; byte[1] = byte[2]; byte[2] = tmp; 100 98 if (average[averageSeq[i]].objID == objIDalt) { 101 fprintf (stderr, "objID is byte-swapped, repairing\n"); 102 measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 103 } else if (measure[measureSeq[i]].objID == 0) { 104 fprintf (stderr, "objID is 0, repairing\n"); 105 measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 99 myAbort ("measure.objID is byte-swapped, consider repairing\n"); 100 // measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 101 } 102 if (measure[measureSeq[i]].objID == 0) { 103 myAbort ("measure.objID is 0, repairing\n"); 104 // measure[measureSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this... 106 105 } else { 107 myAbort ("objID is NOT byte-swapped , aborting\n");106 myAbort ("objID is NOT byte-swapped and NOT 0, aborting\n"); 108 107 } 109 108 } 110 # else109 # if (0) 111 110 // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID. 112 111 // this happened for 28 detections in the dbs on /data/stsci1?.0/eugene/dvo3pi.20130616, but not at all (as far as I know) in the rest of LAP DVO … … 243 242 // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't) 244 243 myAssert(average[averageSeq[i]].catID == lensing[lensingSeq[i]].catID, "object / detection mismatch"); 245 # if (1)246 244 myAssert(average[averageSeq[i]].objID == lensing[lensingSeq[i]].objID, "object / detection mismatch"); 247 # else248 // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID.249 // this happened for 28 detections in the dbs on /data/stsci1?.0/eugene/dvo3pi.20130616, but not at all (as far as I know) in the rest of LAP DVO250 if (average[averageSeq[i]].objID != lensing[lensingSeq[i]].objID) {251 fprintf (stderr, "R");252 lensing[lensingSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this...253 }254 # endif255 245 } 256 246 } … … 380 370 // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't) 381 371 myAssert(average[averageSeq[i]].catID == starpar[starparSeq[i]].catID, "object / detection mismatch"); 382 # if (1)383 372 myAssert(average[averageSeq[i]].objID == starpar[starparSeq[i]].objID, "object / detection mismatch"); 384 # else385 // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID.386 // this happened for 28 detections in the dbs on /data/stsci1?.0/eugene/dvo3pi.20130616, but not at all (as far as I know) in the rest of LAP DVO387 if (average[averageSeq[i]].objID != starpar[starparSeq[i]].objID) {388 fprintf (stderr, "R");389 starpar[starparSeq[i]].objID = average[averageSeq[i]].objID; // XXX I don't really like this...390 }391 # endif392 373 } 393 374 }
Note:
See TracChangeset
for help on using the changeset viewer.
