IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 14, 2022, 8:33:33 PM (4 years ago)
Author:
eugene
Message:

add option to get box size in pixels; add function to get vector/matrix sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/reindex.c

    r42082 r42305  
    7272    }
    7373  }
     74  if (ivec->type == OPIHI_STR) {
     75    opihi_int *vx = xvec[0].elements.Int;
     76    for (Npts = i = 0; i < xvec[0].Nelements; i++, vx++) {
     77      if (Npts >= NPTS) {
     78        NPTS += 2000;
     79        REALLOCATE (ovec[0].elements.Str, char *, NPTS);
     80      }
     81      if (*vx < 0) {
     82        if (KEEP_UNMATCH) {
     83          ovec[0].elements.Str[Npts] = strcreate(""); // XXX use a different or a specified value?
     84          Npts++;
     85        }
     86        continue;
     87      }
     88      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
     89      ovec[0].elements.Str[Npts] = strcreate(ivec->elements.Str[*vx]);
     90      Npts++;
     91    }
     92  }
    7493
    7594  // free up unused memory
Note: See TracChangeset for help on using the changeset viewer.