IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36022


Ignore:
Timestamp:
Aug 25, 2013, 12:10:07 PM (13 years ago)
Author:
eugene
Message:

add join, fix vlist argument, update help for match2d

Location:
branches/eam_branches/ipp-20130711/Ohana/src
Files:
1 added
6 edited

Legend:

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

    r35755 r36022  
    696696void sort_coords_index (double *X, double *Y, off_t *S, off_t N);
    697697void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N);
     698void sort_IDs_indexonly (opihi_int *X, off_t *S, off_t N);
    698699void sort_regions (SkyRegion *region, off_t N);
    699700
  • branches/eam_branches/ipp-20130711/Ohana/src/libdvo/src/dvosorts.c

    r35263 r36022  
    6060
    6161/* sort a coordinate pair (X,Y) and the associated index (S) */
     62void sort_IDs_indexonly (opihi_int *X, off_t *S, off_t N) {
     63 
     64# define SWAPFUNC(A,B){ off_t itmp; \
     65  itmp = S[A]; S[A] = S[B]; S[B] = itmp; \
     66}
     67# define COMPARE(A,B)(X[S[A]] < X[S[B]])
     68
     69  OHANA_SORT (N, COMPARE, SWAPFUNC);
     70
     71# undef SWAPFUNC
     72# undef COMPARE
     73
     74}
     75
     76/* sort a coordinate pair (X,Y) and the associated index (S) */
    6277void sort_coords_indexonly (double *X, double *Y, off_t *S, off_t N) {
    6378 
  • branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.data/Makefile

    r35875 r36022  
    6666$(SRC)/integrate.$(ARCH).o      \
    6767$(SRC)/interpolate.$(ARCH).o    \
     68$(SRC)/join.$(ARCH).o           \
    6869$(SRC)/jpeg.$(ARCH).o           \
    6970$(SRC)/kern.$(ARCH).o           \
  • branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.data/init.c

    r35875 r36022  
    5555int integrate        PROTO((int, char **));
    5656int interpolate      PROTO((int, char **));
     57int join             PROTO((int, char **));
    5758int jpeg             PROTO((int, char **));
    5859int kern             PROTO((int, char **));
     
    210211  {1, "integrate",    integrate,        "integrate a vector"},
    211212  {1, "interpolate",  interpolate,      "interpolate between vector pairs"},
     213  {1, "join",         join,             "find the join of two ID vectors"},
    212214  {1, "jpeg",         jpeg,             "convert display image to JPEG"},
    213215  {1, "kern",         kern,             "convolve with 3x3 kernel"},
  • branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.data/match2d.c

    r33963 r36022  
    1414  Vector *index1, *index2;
    1515
     16  if ((N = get_argument (argc, argv, "-h"))) goto usage;
     17  if ((N = get_argument (argc, argv, "--help"))) goto usage;
     18
    1619  CLOSEST = FALSE;
    1720  if ((N = get_argument (argc, argv, "-closest"))) {
     
    3841  if (argc != 6) {
    3942    gprint (GP_ERR, "USAGE: match2d X1 Y1 X2 Y2 Radius [-index1 (index1)] [-index2 (index2)] [-closest]\n");
    40     gprint (GP_ERR, "  if -closest is provided, index1 & index2 will have the same length as X1 and X2 (respectively)\n");
    41     gprint (GP_ERR, "    with either the index of the match or a value of -1 for non-matches\n");
     43    gprint (GP_ERR, "  use -h or --help for more detail\n");
    4244    return (FALSE);
    4345  }
     
    9092
    9193  return (TRUE);
     94
     95usage:
     96  gprint (GP_ERR, "we have two modes of operation:\n\n");
     97
     98  gprint (GP_ERR, "without -closest, we are finding all matched pairs within the match radius.  in this\n");
     99  gprint (GP_ERR, "case, the two index vectors have the same length, one entry per matched pair.\n");
     100  gprint (GP_ERR, "x1[index1],y1[index1] matches to x2[index2],y2[index2].\n\n");
     101
     102  gprint (GP_ERR, "with -closest selected, we are finding the closest element of set 1 to each of set 2\n");
     103  gprint (GP_ERR, "and vice versa.  in this case, index1 is always the same length as x1,y1, while index2\n");
     104  gprint (GP_ERR, "is the same lengths as x2,y2.  x2[index1],y2[index1] matches x1,y1 while\n");
     105  gprint (GP_ERR, "x1[index2],y1[index2] matches x2,y2\n\n");
     106
     107  gprint (GP_ERR, "if -index1 or -index2 is not supplied, the vectors are created with names index1 or index2\n");
     108  gprint (GP_ERR, "use 'reindex' to generate new vectors based on these index vectors\n");
     109
     110  return FALSE;
    92111}
    93112
  • branches/eam_branches/ipp-20130711/Ohana/src/opihi/cmd.data/vlist.c

    r35875 r36022  
    1919    }
    2020    INT = TRUE;
     21    remove_argument (N, &argc, argv);
    2122  }
    2223
Note: See TracChangeset for help on using the changeset viewer.