IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2006, 5:26:07 PM (20 years ago)
Author:
eugene
Message:

added periodogram, tests, some minor bugs

Location:
trunk/Ohana/src/opihi/cmd.data
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r5943 r6642  
    6868$(SDIR)/mset.$(ARCH).o          \
    6969$(SDIR)/peak.$(ARCH).o          \
     70$(SDIR)/periodogram.$(ARCH).o   \
    7071$(SDIR)/plot.$(ARCH).o          \
    7172$(SDIR)/dot.$(ARCH).o           \
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r5850 r6642  
    5353int mset             PROTO((int, char **));
    5454int peak             PROTO((int, char **));
     55int periodogram      PROTO((int, char **));
    5556int plot             PROTO((int, char **));
    5657int dot              PROTO((int, char **));
     
    160161  {"mset",         mset,             "insert a vector in a matrix"},
    161162  {"peak",         peak,             "find vector peak in range"},
     163  {"periodogram",  periodogram,      "measure periods in unevenly sampled data"},
    162164  {"plot",         plot,             "plot a pair of vectors"},
    163165  {"dot",          dot,              "plot a single point"},
  • trunk/Ohana/src/opihi/cmd.data/peak.c

    r4689 r6642  
    33int peak (int argc, char **argv) {
    44 
    5   int i, imax;
     5  int i, N, imax, QUIET;
    66  double start, end, xmax, ymax;
    77  float *X, *Y;
    88  Vector *vecx, *vecy;
    99
    10   if (argc != 5) {
    11     fprintf (stderr, "USAGE: peak <x> <y> start end\n");
     10  QUIET = FALSE;
     11  if ((N = get_argument (argc, argv, "-q"))) {
     12    QUIET = TRUE;
     13    remove_argument (N, &argc, argv);
     14  }
     15
     16  if ((argc != 5) && (argc != 3)) {
     17    fprintf (stderr, "USAGE: peak <x> <y> [start end]\n");
    1218    return (FALSE);
    1319  }
     
    1622  if ((vecy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
    1723
    18   start = atof (argv[3]);
    19   end   = atof (argv[4]);
     24  if (argc == 5) {
     25    start = atof (argv[3]);
     26    end   = atof (argv[4]);
     27  } else {
     28    start = vecx[0].elements[0];
     29    end   = vecx[0].elements[vecx[0].Nelements - 1];
     30  }
    2031
    2132  X = vecx[0].elements;
     
    3950  set_variable ("peaknum", imax);
    4051
    41   fprintf (stderr, "peak %f @ %f (%d)\n", ymax, xmax, imax);
     52  if (!QUIET) fprintf (GetOutfile(), "peak %f @ %f (%d)\n", ymax, xmax, imax);
    4253
    4354  return (TRUE);
    4455}
    45 
  • trunk/Ohana/src/opihi/cmd.data/write_vectors.c

    r2843 r6642  
    4141  for (i = 0; i < Nvec; i++) {
    4242    if ((vec[i] = SelectVector (argv[i + 2], OLDVECTOR, FALSE)) == NULL) {
     43      fprintf (stderr, "unknown vector %s\n", argv[i+2]);
    4344      fprintf (stderr, "USAGE: write (file) vector vector ...\n");
    4445      free (vec);
Note: See TracChangeset for help on using the changeset viewer.