IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 5, 2010, 2:29:00 PM (16 years ago)
Author:
bills
Message:

Enhance dvomerge to handle merging catdirs with different (but compatible) secondary filter lists

Location:
trunk/Ohana/src/libdvo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/include/dvo.h

    r27817 r28855  
    318318
    319319PhotCodeData *GetPhotcodeTable (void);
     320void SetPhotcodeTable (PhotCodeData *);
     321
     322int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input);
    320323
    321324int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite);
  • trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r24974 r28855  
    2121PhotCodeData *GetPhotcodeTable () {
    2222
    23   /* allocate space to photcode table, free existing data */
    2423  if (photcodes == NULL) {
     24    /* allocate space to photcode table */
    2525    ALLOCATE (photcodes, PhotCodeData, 1);
    2626    photcodes[0].code = NULL;
    2727  }
    2828  return photcodes;
     29}
     30
     31// set the photcode table. This is used to switch between serveral previously
     32// allocated tables
     33void SetPhotcodeTable (PhotCodeData *new) {
     34  photcodes = new; 
    2935}
    3036
     
    531537}
    532538
     539// Create a map between the secfilt values from one photcode table to another
     540int *GetSecFiltMap(PhotCodeData *output, PhotCodeData *input) {
     541  int i;
     542  int NsecfiltIn  = input[0].Nsecfilt;
     543  int *map;
     544  ALLOCATE(map, int, NsecfiltIn);
     545
     546  // loop over entries
     547  for (i = 0; i < NsecfiltIn; i++) {
     548    int code  = input[0].codeNsec[i];
     549    int entry = output[0].hashcode[code];
     550    if (entry == -1) {
     551      // entry is missing
     552      free(map);
     553      return(FALSE);
     554    }
     555    map[i] = entry;
     556  }
     557
     558  return map;
     559}
     560
    533561/* photcode table should have the following format:
    534562
Note: See TracChangeset for help on using the changeset viewer.