IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30983


Ignore:
Timestamp:
Mar 18, 2011, 6:09:58 PM (15 years ago)
Author:
watersc1
Message:

Added -C mode to calculate matches using great circle distances instead of Cartesian distances. It's much slower, but that's the tradeoff

Location:
trunk/Ohana/src/gcompare
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/gcompare/Makefile

    r12842 r30983  
    2424$(SRC)/compare.$(ARCH).o                        $(SRC)/sort.$(ARCH).o                   \
    2525$(SRC)/count_neighbors.$(ARCH).o                $(SRC)/nextline.$(ARCH).o               \
    26 $(SRC)/nextword.$(ARCH).o                       $(SRC)/gcompare.$(ARCH).o
     26$(SRC)/nextword.$(ARCH).o                       $(SRC)/gcompare.$(ARCH).o               \
     27$(SRC)/gc_compare.$(ARCH).o
    2728
    2829$(GCOMPARE): $(INC)/gcompare.h
  • trunk/Ohana/src/gcompare/include/gcompare.h

    r21153 r30983  
    2626data_type          input             PROTO((char *, int, int, int));
    2727match_type        *compare           PROTO((data_type, data_type, int *, double, double, double, double));
     28match_type        *gc_compare        PROTO((data_type, data_type, int *, double, double, double, double));
    2829int                get_argument      PROTO((int, char **, char *));
    2930int                remove_argument   PROTO((int, int *, char **));
  • trunk/Ohana/src/gcompare/src/gcompare.c

    r16040 r30983  
    66 
    77  int Nskip1, Nskip2, Nmatches, N;
    8   int X1, X2, Y1, Y2, deltas, match, nomatch1, nomatch2;
     8  int X1, X2, Y1, Y2, deltas, match, nomatch1, nomatch2, greatcircle;
    99  data_type data1, data2;
    1010  match_type *matches;
     
    1212
    1313  DX = DY = Nskip1 = Nskip2 = 0;
    14   noauto = match = nomatch1 = nomatch2 = deltas = FALSE;
     14  noauto = match = nomatch1 = nomatch2 = deltas = greatcircle = FALSE;
    1515
    1616  if (remove_argument(get_argument (argc, argv, "-d"), &argc, argv))
     
    2626  if (remove_argument(get_argument (argc, argv, "-n2"), &argc, argv))
    2727    nomatch2 = TRUE;
     28  if (remove_argument(get_argument (argc, argv, "-C"), &argc, argv))
     29    greatcircle = TRUE;
    2830  if (!(match || deltas || nomatch1 || nomatch2)) {
    2931    fprintf (stderr, "no output mode, use at least one of -d, -m, -n1, or -n2\n");
     
    7577
    7678  fprintf (stderr, "noauto: %e\n", noauto);
    77   matches = compare (data1, data2, &Nmatches, radius, DX, DY, noauto);
     79  if (greatcircle) {
     80    matches = gc_compare (data1, data2, &Nmatches, radius, DX, DY, noauto);
     81  }
     82  else {
     83    matches = compare (data1, data2, &Nmatches, radius, DX, DY, noauto);
     84  }
     85
    7886
    7987  output (data1, data2, matches, Nmatches, match, deltas, nomatch1, nomatch2);
     
    9098  fprintf (stderr, "  -d      return delta coords\n");
    9199  fprintf (stderr, "  -m      return matched lines\n");
     100  fprintf (stderr, "  -C      uses great circle calculation\n");
    92101  fprintf (stderr, "  -n1     return unmatched lines, file 1\n");
    93102  fprintf (stderr, "  -n2     return unmatched lines, file 2\n");
Note: See TracChangeset for help on using the changeset viewer.