IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2017, 10:53:48 AM (9 years ago)
Author:
eugene
Message:

merge EAM development branch changes for DR2 into trunk (add PS1_V6 dvo format; change Mcal to McalPSF, McalAPER; change opihi int vectors to 64bit)

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.data/print_vectors.c

    r37049 r40291  
    44
    55  Vector **vec;
    6   int i, j;
     6  int i, j, N;
     7
     8  int START_VALUE = 0;
     9  if ((N = get_argument (argc, argv, "-s"))) {
     10    remove_argument (N, &argc, argv);
     11    START_VALUE = atoi (argv[N]);
     12    remove_argument (N, &argc, argv);
     13  }
     14
     15  int END_VALUE = -1;
     16  if ((N = get_argument (argc, argv, "-e"))) {
     17    remove_argument (N, &argc, argv);
     18    END_VALUE = atoi (argv[N]);
     19    remove_argument (N, &argc, argv);
     20  }
    721
    822  if (argc < 2) {
     
    2741  }
    2842
    29   for (j = 0; j < MaxLen; j++) {
     43  // start and end may be 0 - N (truncated to N) or may be negative, in which case it refers to
     44  // distance from the end (just like vector[-5])
     45  START_VALUE = (START_VALUE < 0) ? MaxLen + START_VALUE + 1 : MIN (START_VALUE, MaxLen);
     46  START_VALUE = MAX (0, START_VALUE);
     47
     48  END_VALUE = (END_VALUE < 0) ? MaxLen + END_VALUE + 1 : MIN (END_VALUE, MaxLen);
     49  END_VALUE = MAX (0, END_VALUE);
     50
     51  for (j = START_VALUE; j < END_VALUE; j++) {
    3052    for (i = 0; i < Nvec; i++) {
    3153      if (j >= vec[i][0].Nelements) {
     
    3557          gprint (GP_LOG, "%f ", vec[i][0].elements.Flt[j]);
    3658        } else {
    37           gprint (GP_LOG, "%d ", vec[i][0].elements.Int[j]);
     59          gprint (GP_LOG, OPIHI_INT_FMT" ", vec[i][0].elements.Int[j]);
    3860        }
    3961      }
Note: See TracChangeset for help on using the changeset viewer.