IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42691


Ignore:
Timestamp:
Jun 24, 2024, 8:56:07 AM (2 years ago)
Author:
eugene
Message:

when merging catdirs, match the SECFILT entries by photcode name, not number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20230313/Ohana/src/libdvo/src/dvo_photcode_utils.c

    r33649 r42691  
    11# include <dvo.h>
     2
     3/* the photcode table includes a number of SEC types, photcodes->Nsecfilt
     4   hashNsec[code] returns the number in the sequence 0 - Nsecfilt for a given SEC code
     5*/
     6
     7// these APIs originally just matched by number of the code, but they should
     8// match by the *name* of the photcode (e.g., g = g)
    29
    310// Create a map between the secfilt values from one photcode table to another
     
    1118  // loop over entries in the input table
    1219  for (i = 0; i < NsecfiltIn; i++) {
    13     int code  = input[0].codeNsec[i];
     20    int inseq  = input[0].codeNsec[i];
     21    myAssert (inseq > -1, "invalid SEC");
     22    int incode   = input[0].hashcode[inseq];
    1423    int entry = -1;
    1524    // find the matching entry in the output table
    1625    for (j = 0; j < NsecfiltOut; j++) {
    17       int outcode = output[0].codeNsec[j];
    18       if (code == outcode) {
    19          entry = j;
    20          break;
    21       }
     26      int outseq = output[0].codeNsec[j];
     27      myAssert (outseq > -1, "invalid SEC");
     28      int outcode   = output[0].hashcode[outseq];
     29      if (strcmp (input[0].code[incode].name, output[0].code[outcode].name)) continue;
     30      entry = j;
     31      break;
    2232    }
    23     // if (entry == -1) {
    24     //   // entry is missing fail (no printfs in this file)
    25     //   free(map);
    26     //   return(FALSE);
    27     // }
    28 
    2933    // if entry is still -1, we will skip this one (not map into the output db)
    3034    map[i] = entry;
Note: See TracChangeset for help on using the changeset viewer.