IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28988


Ignore:
Timestamp:
Aug 20, 2010, 10:56:07 AM (16 years ago)
Author:
eugene
Message:

updates for flexible dvomerge photcodes

Location:
branches/eam_branches/ipp-20100621/Ohana/src/libdvo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/Ohana/src/libdvo/include/dvo.h

    r28891 r28988  
    329329
    330330PhotCodeData *GetPhotcodeTable (void);
     331void SetPhotcodeTable (PhotCodeData *);
     332
     333int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input);
    331334
    332335int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite);
  • branches/eam_branches/ipp-20100621/Ohana/src/libdvo/src/LoadPhotcodesText.c

    r17190 r28988  
    109109
    110110    photcode[Ncode].type = 0;
     111    memset(photcode[Ncode].dummy, 0, sizeof(photcode[Ncode].dummy));
    111112    photcode[Ncode].code = code;
    112113    memset (photcode[Ncode].name, 0, 32);
  • branches/eam_branches/ipp-20100621/Ohana/src/libdvo/src/coordops.c

    r28725 r28988  
    4141    *L += X2*coords[0].polyterms[0][0] + XY*coords[0].polyterms[1][0] + Y2*coords[0].polyterms[2][0];
    4242    *M += X2*coords[0].polyterms[0][1] + XY*coords[0].polyterms[1][1] + Y2*coords[0].polyterms[2][1];
    43   }
    44   if (coords[0].Npolyterms > 2) {
    45     X3 = X2*X;
    46     Y3 = Y2*Y;
    47     *L += X3*coords[0].polyterms[3][0] + X2*Y*coords[0].polyterms[4][0] + X*Y2*coords[0].polyterms[5][0] + Y3*coords[0].polyterms[6][0];
    48     *M += X3*coords[0].polyterms[3][1] + X2*Y*coords[0].polyterms[4][1] + X*Y2*coords[0].polyterms[5][1] + Y3*coords[0].polyterms[6][1];
     43
     44    if (coords[0].Npolyterms > 2) {
     45      X3 = X2*X;
     46      Y3 = Y2*Y;
     47      *L += X3*coords[0].polyterms[3][0] + X2*Y*coords[0].polyterms[4][0] + X*Y2*coords[0].polyterms[5][0] + Y3*coords[0].polyterms[6][0];
     48      *M += X3*coords[0].polyterms[3][1] + X2*Y*coords[0].polyterms[4][1] + X*Y2*coords[0].polyterms[5][1] + Y3*coords[0].polyterms[6][1];
     49    }
    4950  }
    5051
  • branches/eam_branches/ipp-20100621/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r24974 r28988  
    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.