IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38744


Ignore:
Timestamp:
Sep 16, 2015, 10:13:32 AM (11 years ago)
Author:
eugene
Message:

do not automatically repair any objID problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/addstar/src/resort_catalog.c

    r38737 r38744  
    4040  resort_catalog_lensing (catalog);
    4141  resort_catalog_starpar (catalog);
    42 
    43   // XXX somehow need to set the value of lensing->measure offset here
    4442}
    4543
     
    8583      // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't)
    8684      myAssert(average[averageSeq[i]].catID == measure[measureSeq[i]].catID, "object / detection mismatch");
    87 # if (1)
    8885      // 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, abort
     86
     87      // Check some possible causes for objID failures
    9188      if (average[averageSeq[i]].objID != measure[measureSeq[i]].objID) {
    9289        fprintf (stderr, "object / detection mismatch average.objID = %d, measure.objID = %d, catID: %d, detID: %d",
    9390                 average[averageSeq[i]].objID, measure[measureSeq[i]].objID,
    9491                 measure[measureSeq[i]].catID, measure[measureSeq[i]].detID);
     92        // is the byte-swapped value the correct objID?
    9593        int objIDalt = measure[measureSeq[i]].objID;
    9694        char *byte = (char *) &objIDalt;
     
    9997        tmp = byte[1]; byte[1] = byte[2]; byte[2] = tmp;
    10098        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...
    106105        } else {
    107           myAbort ("objID is NOT byte-swapped, aborting\n");
     106          myAbort ("objID is NOT byte-swapped and NOT 0, aborting\n");
    108107        }
    109108      }
    110 # else
     109# if (0)
    111110      // for reasons I do not understand, the mini dvodbs generated on stsci1X had a handful of detections with an inconsistency between averef and objID. 
    112111      // 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
     
    243242      // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't)
    244243      myAssert(average[averageSeq[i]].catID == lensing[lensingSeq[i]].catID, "object / detection mismatch");
    245 # if (1)
    246244      myAssert(average[averageSeq[i]].objID == lensing[lensingSeq[i]].objID, "object / detection mismatch");
    247 # else
    248       // 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 DVO
    250       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 # endif
    255245    }
    256246  }
     
    380370      // earlier formats did not carry the objID or catID, so they are not available (we could assign on load, but we don't)
    381371      myAssert(average[averageSeq[i]].catID == starpar[starparSeq[i]].catID, "object / detection mismatch");
    382 # if (1)
    383372      myAssert(average[averageSeq[i]].objID == starpar[starparSeq[i]].objID, "object / detection mismatch");
    384 # else
    385       // 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 DVO
    387       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 # endif
    392373    }
    393374  }
Note: See TracChangeset for help on using the changeset viewer.