IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40583 for trunk


Ignore:
Timestamp:
Dec 12, 2018, 11:09:18 AM (8 years ago)
Author:
eugene
Message:

add elements to get skycellID from tess table for some tessellations

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

Legend:

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

    r40463 r40583  
    442442  int    **cell; // zone,band -> proj cell sequence
    443443  int    **projID; // zone,band -> proj cell ID
     444  int    **skycellID; // zone,band -> starting skycell ID
    444445  char  ***name; // projection cell name
    445446 
  • trunk/Ohana/src/libdvo/src/BoundaryTree.c

    r39480 r40583  
    2727    FREE (tree->cell[i]);
    2828    FREE (tree->projID[i]);
     29    FREE (tree->skycellID[i]);
    2930    FREE (tree->name[i]);
    3031  }
     
    3839  FREE (tree->cell);
    3940  FREE (tree->projID);
     41  FREE (tree->skycellID);
    4042  FREE (tree->name);
    4143
     
    155157  ALLOCATE (tree->cell,    int *, tree->Nzone);
    156158  ALLOCATE (tree->projID,  int *, tree->Nzone);
     159  ALLOCATE (tree->skycellID,  int *, tree->Nzone);
    157160  ALLOCATE (tree->name,  char **, tree->Nzone);
    158161  for (i = 0; i < tree->Nzone; i++) {
     
    165168    ALLOCATE (tree->cell[i],    int, tree->Nband[i]);
    166169    ALLOCATE (tree->projID[i],  int, tree->Nband[i]);
     170    ALLOCATE (tree->skycellID[i],  int, tree->Nband[i]);
    167171    ALLOCATE (tree->name[i], char *, tree->Nband[i]);
    168172    for (j = 0; j < tree->Nband[i]; j++) {
     
    208212    memcpy(tree->name[nz][nb], &name[i*BOUNDARY_TREE_NAME_LENGTH], BOUNDARY_TREE_NAME_LENGTH);
    209213    // XXX parse out the ID from the name (skycell.NNNN)
    210     tree->projID[nz][nb] = atoi(&tree->name[nz][nb][8]);
     214    char *endptr = NULL;
     215    tree->projID[nz][nb] = strtol(&tree->name[nz][nb][8], &endptr, 10);
     216    if (endptr[0] == '.') {
     217      // we have elements after the projID, which should be the skycell ID
     218      endptr ++;
     219      tree->skycellID[nz][nb] = strtol(endptr, NULL, 10);
     220    } else {
     221      tree->skycellID[nz][nb] = -1;
     222    }
    211223  }
    212224
  • trunk/Ohana/src/libdvo/src/TessellationTable.c

    r39480 r40583  
    579579    *tessID = myTess;
    580580    *projID = tess[myTess].tree->projID[zone][band];
    581     *skycellID = N;
     581    if (tess[myTess].tree->skycellID[zone][band] == -1) {
     582      *skycellID = N;
     583    } else {
     584      *skycellID = tess[myTess].tree->skycellID[zone][band] + N;
     585    }     
    582586
    583587    return TRUE;
Note: See TracChangeset for help on using the changeset viewer.