IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42305


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

Location:
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data
Files:
1 added
4 edited

Legend:

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

    r42166 r42305  
    154154$(SRC)/set.$(ARCH).o            \
    155155$(SRC)/shift.$(ARCH).o          \
     156$(SRC)/opihi_size.$(ARCH).o        \
    156157$(SRC)/sort.$(ARCH).o           \
    157158$(SRC)/spline.$(ARCH).o         \
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/init.c

    r42166 r42305  
    160160int tvgrid           PROTO((int, char **));
    161161int opihi_type       PROTO((int, char **));
     162int opihi_size       PROTO((int, char **));
    162163int uniq             PROTO((int, char **));
    163164int uniqpair         PROTO((int, char **));
     
    350351  {1, "set",          set,              "image and vector math"},
    351352  {1, "shift",        shift,            "shift data in an image"},
     353  {1, "size",         opihi_size,       "get vector/matrix dimension/size information"},
    352354  {1, "sort",         sort_vectors,     "sort list of vectors"},
    353355  {1, "spline",       spline_command,   "shift data in an image"},
  • branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/limits.c

    r40291 r42305  
    6161    APPLY = TRUE;
    6262  }
     63
    6364  char *name = NULL;
    6465  if ((N = get_argument (argc, argv, "-n"))) {
     
    6768    remove_argument (N, &argc, argv);
    6869  }
    69 
    7070  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
    7171  FREE (name);
     72
     73  // this is not super intuitive
     74  if ((N = get_argument (argc, argv, "-boxsize"))) {
     75    remove_argument (N, &argc, argv);
     76    float dx, dy;
     77    // ask kapa for the size of the graph region in pixels
     78    KapaGetLimits (kapa, &dx, &dy);
     79    set_variable ("KAPA_XPIX", fabs(dx));
     80    set_variable ("KAPA_YPIX", fabs(dy));
     81  }
    7282
    7383  // XXX need an option to set the limits based on the current image bounds
     
    169179  return (TRUE);
    170180}
     181
     182/* -minX value : the minimum X axis value will be no higher than this value
     183   -maxX value : the maximum X axis value will be no lower than this value
     184   -delX value : the range of the X axis will be at least this value
     185
     186   These can be used to prevent the range from collapsing. 
     187   These are only used if the -a option is supplied, otherwise the supplied or auto-calculated
     188   ranges are used (this seems like an poor choice)
     189
     190*/
     191
     192
     193   
  • 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.