IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2010, 2:41:43 PM (15 years ago)
Author:
rhenders
Message:

now checking for bogus IPP detection IDs and skipping them; increased MAXDETECT limit to 200000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/src/DetectionBatch.c

    r30147 r30189  
    8282
    8383    // stuff for detections table
    84     uint32_t s,d, invalidDvoRows, smfJumps, unmatched, totalDetections = 0;
     84    uint32_t s,d, invalidDvoRows, unmatched, totalDetections = 0;
    8585
    8686    long longnull = -999;
     
    123123    long i;
    124124    bool isDuplicate;
    125     uint32_t numOfDuplicates, numInvalidFlux;
     125    uint32_t numOfDuplicates, numInvalidFlux, numOfInvalidIppIDet;
    126126    long numDetectionsOut, totalDetectionsOut = 0, numPhotoRef, totalNumPhotoRef = 0;
    127127    long* removeList = (long*)calloc(this->MAXDETECT, sizeof(long));
     
    184184            numDvoDetections = dvoGetDetections(skylist, image->imageID, &dvoDetections, &maxDvoDetId);
    185185
    186 
    187186            if (numDvoDetections > this->MAXDETECT ) {
    188187
     
    227226
    228227            // loop round detections to populate some extra stuff
    229             s = d = totalDetections = invalidDvoRows = smfJumps = unmatched = 0;
     228            s = d = totalDetections = invalidDvoRows = unmatched = 0;
    230229
    231230            // determine column numbers for certain IPP detection columns
     
    254253            numOfDuplicates = 0;
    255254            numInvalidFlux = 0;
     255            numOfInvalidIppIDet = 0;
    256256            for (long s = 0; s<nDet; s++) {
    257257
    258258                isDuplicate = false;
    259259
    260                 // count jumps in smf file
    261                 if (s>0 && (ippIDet[s] != (ippIDet[s-1] + 1))) smfJumps++;
    262 
    263                 while (ippIDet[s] > dvoDetections[d].meas.detID && dvoDetections[d].meas.detID <= maxDvoDetId) {
    264 
    265                     d++;
    266                     if (!dvoDetections[d].valid) invalidDvoRows++;
     260                // catch crazy large or negative IPP_IDET
     261                if (ippIDet[s] < 0 || ippIDet[s] > maxDvoDetId) {
     262
     263                    removeList[numOfDuplicates+numInvalidFlux+numOfInvalidIppIDet] = s+1;
     264                    numOfInvalidIppIDet++;
    267265                }
    268 
     266                else {
     267                    while (ippIDet[s] > dvoDetections[d].meas.detID && dvoDetections[d].meas.detID <= maxDvoDetId) {
     268
     269                        d++;
     270                        if (!dvoDetections[d].valid) invalidDvoRows++;
     271                    }
     272                }
    269273                if (ippIDet[s] == dvoDetections[d].meas.detID ) {
    270274
     
    273277                    for (i=0; i<totalDetections; i++) {
    274278                        if (thisObjId == objID[i]) {
    275                             removeList[numOfDuplicates+numInvalidFlux] = s+1;
     279                            removeList[numOfDuplicates+numInvalidFlux+numOfInvalidIppIDet] = s+1;
    276280                            numOfDuplicates++;
    277281                            isDuplicate=true;
     
    296300                    // check for invalid flux values (if not already labelled as a duplicate)
    297301                    if ( (!peakFluxOk || !instFluxOk) && !isDuplicate) {
    298                         removeList[numOfDuplicates+numInvalidFlux] = s+1;
     302                        removeList[numOfDuplicates+numInvalidFlux+numOfInvalidIppIDet] = s+1;
    299303                        numInvalidFlux++;
    300304                    }
     
    501505    }
    502506
    503     this->MAXDETECT = 150000;
     507    this->MAXDETECT = 200000;
    504508
    505509    this->print = print;
Note: See TracChangeset for help on using the changeset viewer.