IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2010, 3:47:10 PM (16 years ago)
Author:
eugene
Message:

fixing avmatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/avmatch.c

    r27594 r27610  
    8383    if ((vec[i] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
    8484    ResetVector (vec[i], fields[i].type, NPTS);
     85    for (n = 0; n < vec[i][0].Nelements; n++) {
     86      if (vec[i][0].type == OPIHI_FLT) {
     87        vec[i][0].elements.Flt[n] = NAN;
     88      } else {
     89        vec[i][0].elements.Int[n] = 0; // or NAN_INT?
     90      }
     91    }
    8592  }
    8693  ALLOCATE (index, off_t, NPTS);
     
    103110    }
    104111    dvo_catalog_unlock (&catalog);  /// we can unlock here since this is read-only (do not block other access)
     112    if (catalog.Naverage == 0) {
     113      dvo_catalog_free (&catalog);
     114      continue;
     115    }
    105116
    106117    find_matches_by_vectors (skylist[0].regions[i], &catalog, RAvec, DECvec, RADIUS, index);
     
    111122
    112123      if (Ncat == -1) continue;
    113       if (Ncat == -2) {
    114         for (n = 0; n < Nfields; n++) {
    115           if (vec[n][0].type == OPIHI_FLT) {
    116             vec[n][0].elements.Flt[Npts] = NAN;
    117           } else {
    118             vec[n][0].elements.Int[Npts] = 0; // or NAN_INT?
    119           }
    120         }
    121         continue;
    122       }
     124      if (Ncat == -2) continue;
     125
    123126      // XXX set a 'found' vector to double check we catch everything?
    124127      m = catalog.average[Ncat].measureOffset;
     
    148151  dbFreeFields (fields, Nfields);
    149152  SkyListFree (skylist);
    150   dvo_catalog_free (&catalog);
    151153  return (TRUE);
    152154
     
    156158  dbFreeFields (fields, Nfields);
    157159  SkyListFree (skylist);
    158   dvo_catalog_free (&catalog);
    159160  return (FALSE);
    160161
Note: See TracChangeset for help on using the changeset viewer.