IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 18, 2018, 11:28:51 AM (8 years ago)
Author:
eugene
Message:

adding option for optimal sampling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/periodogram-fm.c

    r40308 r40313  
    88  if ((N = get_argument (argc, argv, "-v"))) {
    99    VERBOSE = TRUE;
     10    remove_argument (N, &argc, argv);
     11  }
     12
     13  int OPTIMAL = FALSE;
     14  if ((N = get_argument (argc, argv, "-optimal"))) {
     15    OPTIMAL = TRUE;
    1016    remove_argument (N, &argc, argv);
    1117  }
     
    8288  // XXX consider choice of period or frequency step
    8389  double P = minP;
    84   for (Np = 0; Np < Nperiods; Np++) {
     90  for (Np = 0; (Np < Nperiods) && (P <= maxP); Np++) {
    8591    double w = 2*M_PI/P;
    8692   
     
    154160    if (VERBOSE) gprint (GP_ERR, "tau: %f, P: %f, ratio: %f, dTime: %f, nextP: %f\n", tau, P, dP, dTime, P*dP);
    155161
     162    if (OPTIMAL) {
     163      dP = 0.4 * SQ(P) / dTime;
     164      P += dP;
     165      continue;
     166    }
     167
    156168    if (LINEAR) {
    157169      P += dP;
Note: See TracChangeset for help on using the changeset viewer.