void Speed::parseOptions (int argc, char** argv) { CommandLine::Menu menu; CommandLine::Argument* arg; menu.set_help_header ("filterbank_speed - measure Filterbank speed"); menu.set_version ("filterbank_speed version 1.0"); arg = menu.add (real_to_complex, 'r'); arg->set_help ("real-to-complex FFT"); arg = menu.add (do_fwd_fft, 'b'); arg->set_help ("do (batched) backward FFTs only"); arg = menu.add (nfft, 'n', "nfft"); arg->set_help ("FFT length"); arg = menu.add (nchan, 'c', "nchan"); arg->set_help ("number of channels"); arg = menu.add (niter, 'N', "niter"); arg->set_help ("number of iterations"); menu.parse (argc, argv); }
void fix_single::add_options ( CommandLine::Menu& menu) { CommandLine::Argument* arg; menu.add(""); arg = menu.add (ext, 'e', "extension"); arg->set_help ("Write new files with this extension"); }
void psredit::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; // blank line in help menu.add (""); arg = menu.add (this, &psredit::add_commands, 'c', "command[s]"); arg->set_help ("one or more commands, separated by commas"); arg = menu.add (this, &psredit::detailed_help, 'H'); arg->set_help ("more detailed help"); arg = menu.add (prefix_name, 'Q'); arg->set_help ("do not prefix output with 'keyword='"); }
void psrflux::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; menu.add("\n" "Dynamic spectrum options:"); arg = menu.add (ext, 'e', "ext"); arg->set_help ("Append extention to output (default .ds)"); arg = menu.add (stdfile, 's', "std"); arg->set_help ("Standard profile file"); arg = menu.add (align, 'a', "align"); arg->set_help ("Align standard with each profile separately"); arg = menu.add (noalign, 'A', "noalign"); arg->set_help ("No fit for profile alignment at all"); }
void example::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; // add a blank line and a header to the output of -h menu.add ("\n" "General options:"); arg = menu.add (subint_indeces, 'i', "subints"); arg->set_help ("select the sub-integration(s) to output"); arg = menu.add (chan_indeces, 'c', "chans"); arg->set_help ("select the frequency channel(s) to output"); arg = menu.add (bin_indeces, 'b', "bins"); arg->set_help ("select the phase bin(s) to output"); arg = menu.add (pol_indeces, 's', "pols"); arg->set_help ("select the polarization(s) to output"); }
void psrsh::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; arg = menu.add (this, &psrsh::interpreter_help, 'H'); arg->set_long_name ("cmd"); arg->set_help ("list available commands"); arg->set_has_arg (optional_argument); arg = menu.add (load_files, 'n'); arg->set_long_name ("nofiles"); arg->set_help ("no filenames required"); menu.set_help_footer ("\n" "If no files are specified, psrsh enters the interactive shell mode \n" "\n" "Otherwise, psrsh enters the shell script command processor mode: \n" "the first file must be the script, and all subseqent archive files \n" "will be processed using this script \n" + menu.get_help_footer ()); }
void psrpca::add_options ( CommandLine::Menu& menu ) { CommandLine::Argument* arg; arg = menu.add ( remove_arch_baseline, "ra" ); arg->set_help ( "Don't remove the baseline of input archives" ); arg = menu.add ( remove_std_baseline, "rs" ); arg->set_help ( "Don't remove the baseline of the template" ); menu.add (""); menu.add ("Fitting options"); arg = menu.add (this, &psrpca::set_standard, 's', "stdfile"); arg->set_help ("Location of standard profile"); arg = menu.add ( apply_shift, "fp" ); arg->set_help ("Don't fit for phase shift"); arg = menu.add ( apply_offset, "fb" ); arg->set_help ("Don't fit for baseline offset"); arg = menu.add ( apply_scale, "fs" ); arg->set_help ("Don't fit for scale"); arg = menu.add ( prof_to_std, "ts" ); arg->set_help ( "Apply scaling, offset and shift to standard instead of profile"); menu.add (""); menu.add ("Regression and Predictor Options"); arg = menu.add (residuals_file, 'r', "residuals"); arg->set_help ("File with residuals"); arg->set_long_help ("As output by tempo2 in the following format: {sat} {post} {err}\n" "They need to be in the same order as the input archives \n" "When used, corrected residuals are output in a file prefix_residuals \n" "The format of the output is: {sat} {input residual} {output residual} {input error}\n" "Note that the output units are us\n"); arg = menu.add (consecutive_points, 'c', "consecutive_points"); arg->set_help ("Choose the number of consecutive points above threshold used during determination of significant eigenvectors"); arg = menu.add (threshold_sigma,'t',"threshold_sigma"); arg->set_help ("Choose the threshold in the units of standard deviation"); menu.add (""); menu.add ("Output options:"); arg = menu.add (save_diffs, "sd"); arg->set_help ("Don't save the difference profiles"); arg = menu.add (save_evecs, "se"); arg->set_help ("Don't save the eigenvectors"); arg = menu.add (save_evals, "sv"); arg->set_help ("Don't save the eigenvalues"); arg = menu.add (save_covariance_matrix, "sc"); arg->set_help ("Don't save the covariance matrix"); arg = menu.add (save_decomps, "sD"); arg->set_help ("Don't save the decompositions"); arg = menu.add (prefix, 'p', "prefix"); arg->set_help ("Set prefix for all the output files"); arg->set_long_help ("Default value: psrpca\n" "The output files for differences profiles, eigenvectors, eigenvalues and covariance matrix\n" "Are: prefix_diffs.ar, prefix_evecs.ar, prefix_evals.dat, prefix_covar.fits, respectively"); }
void psradd::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; arg = menu.add (unload_name, 'o', "fname"); arg->set_help ("output result to 'fname'"); // backward compatibility: -f == -o menu.add( new CommandLine::Alias( arg, 'f' ) ); menu.add ("\n" "General options:"); arg = menu.add (parname, 'E', "f.eph"); arg->set_help ("Load and install new ephemeris from 'f.eph'"); // backward compatibility: -p == -E menu.add( new CommandLine::Alias( arg, 'p' ) ); arg = menu.add (tscrunch_total, 'T'); arg->set_help ("Tscrunch result after each new file added"); // backward compatibility: -s == -T menu.add( new CommandLine::Alias( arg, 's' ) ); arg = menu.add (time_direction, 'R'); arg->set_help ("Append data in the frequency direction"); arg = menu.add (patch_name, 'm', "domain"); arg->set_help ("Patch missing sub-integrations: domain = time or phase"); arg = menu.add (inplace_name, "inplace", "filename"); arg->set_help ("Append archives to the specified file"); arg = menu.add (phase_align, 'P'); arg->set_help ("Phase align archive with total before adding"); arg = menu.add (log_results, 'L'); arg->set_help ("Log results in <source>.log"); arg = menu.add (testing, 't'); arg->set_help ("Test mode: make no changes to file system"); menu.add ("\n" "Restrictions:"); arg = menu.add (this, &psradd::force, 'F'); arg->set_help ("Force append against all conventional wisdom"); arg = menu.add (centre_frequency, 'r', "freq"); arg->set_help ("Add archives only with this centre frequency"); arg = menu.add (check_has_data, 'z'); arg->set_help ("Only add archives that have integration length > 0"); arg = menu.add (required_archive_length, 'Z', "time"); arg->set_help ("Only add archives that are time (+/- 0.5) seconds long"); arg = menu.add (this, &psradd::ignore_phase, "ip"); arg->set_help ("Do not apply model, ignore phase alignment"); menu.add ("\n" "AUTO ADD: tscrunch and unload when ..."); arg = menu.add (cal_phase_diff, 'C', "turns"); arg->set_help ("... CAL phase changes by >= turns"); arg->set_notification (auto_add); arg = menu.add (division_seconds, 'D', "sec"); arg->set_help ("... next archive is from different 'sec' division of MJD"); arg->set_notification (auto_add); arg = menu.add (max_interval_between, 'G', "sec"); arg->set_help ("... time to next archive > 'sec' seconds"); arg->set_notification (auto_add); arg = menu.add (max_interval_within, 'g', "sec"); arg->set_help ("... time spanned exceeds 'sec' seconds"); arg->set_notification (auto_add); arg = menu.add (max_integration_length, 'I', "sec"); arg->set_help ("... integration length exceeds 'sec' seconds"); arg->set_notification (auto_add); arg = menu.add (max_signal_to_noise, 'S', "s/n"); arg->set_help ("... signal-to-noise ratio exceeds 's/n'"); arg->set_notification (auto_add); arg = menu.add (auto_add_tscrunch, "autoT"); arg->set_help ("Disable tscrunch before unloading"); menu.add ("\n" "Note: AUTO ADD options are incompatible with -o and -T"); }
//! Add command line options void dsp::SingleThread::Config::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg; arg = menu.add (this, &Config::set_quiet, 'q'); arg->set_long_name ("Q"); arg->set_help ("quiet mode"); arg = menu.add (this, &Config::set_verbose, 'v'); arg->set_help ("verbose mode"); arg = menu.add (this, &Config::set_very_verbose, 'V'); arg->set_help ("very verbose mode"); menu.add ("\n" "Input handling options:"); arg = menu.add (input_buffering, "overlap"); arg->set_help ("disable input buffering"); arg = menu.add (force_contiguity, "cont"); arg->set_help ("input files are contiguous (disable check)"); arg = menu.add (run_repeatedly, "repeat"); arg->set_help ("repeatedly read from input until an empty is encountered"); arg = menu.add (seek_seconds, 'S', "seek"); arg->set_help ("start processing at t=seek seconds"); arg = menu.add (total_seconds, 'T', "total"); arg->set_help ("process only t=total seconds"); arg = menu.add (&editor, &TextEditor<Observation>::add_commands, "set", "key=value"); arg->set_help ("set observation attributes"); arg = menu.add (list_attributes, "list"); arg->set_help ("list observation attributes"); if (weighted_time_series) { arg = menu.add (weighted_time_series, 'W'); arg->set_help ("disable weights (allow bad data)"); } menu.add ("\n" "Processor options:"); if (can_thread) { arg = menu.add (this, &Config::set_nthread, 't', "threads"); arg->set_help ("number of processor threads"); } #if HAVE_SCHED_SETAFFINITY arg = menu.add (this, &Config::set_affinity, "cpu", "cores"); arg->set_help ("comma-separated list of CPU cores"); #endif #if HAVE_CUFFT if (can_cuda) { arg = menu.add (this, &Config::set_cuda_device, "cuda", "devices"); arg->set_help ("comma-separated list of CUDA devices"); } #endif arg = menu.add (this, &Config::set_fft_library, 'Z', "lib"); arg->set_help ("choose the FFT library ('-Z help' for availability)"); dsp::Operation::report_time = false; arg = menu.add (dsp::Operation::record_time, 'r'); arg->set_help ("report time spent performing each operation"); arg = menu.add (dump_before, "dump", "op"); arg->set_help ("dump time series before performing operation"); }
//! Parse the command line options void Pulsar::Application::parse (int argc, char** argv) { CommandLine::Menu menu; CommandLine::Argument* arg; menu.set_help_header ("\n" + name + " - " + description + "\n" "\n" "usage: " + name + " [options] filename[s] \n" "\n" "where options are:"); if (has_manual) menu.set_help_footer ("\n" "See "PSRCHIVE_HTTP"/manuals/" + name + " for more details \n"); menu.set_version (version); arg = menu.add (this, &Application::set_quiet, 'q'); arg->set_help ("quiet mode"); arg = menu.add (this, &Application::set_verbose, 'v'); arg->set_help ("verbose mode"); arg = menu.add (this, &Application::set_very_verbose, 'V'); arg->set_help ("very verbose mode"); arg = menu.add (metafile, 'M', "metafile"); arg->set_help ("metafile contains list of archive filenames"); arg = menu.add (Config::get_configuration(), &Config::set_filename, "config", "file"); arg->set_help ("configuration file"); for (unsigned i=0; i<options.size(); i++) options[i]->add_options (menu); add_options (menu); menu.parse (argc, argv); dirglob_program = name; if ( stow_script && optind < argc ) { script = argv[optind]; optind ++; } if (!metafile.empty()) stringfload (&filenames, metafile); else { for (int i=optind; i<argc; i++) dirglob (&filenames, argv[i]); if (sort_filenames) sort (filenames.begin(), filenames.end()); } if (update_history) { string separator = " "; command += name + separator; for (int i=1; i<optind; i++) command += argv[i] + separator; if (command.length () > 80) { cerr << "WARNING: ProcHistory command string truncated to 80 characters" << endl; command = command.substr (0, 80); } } }
void parse_options (int argc, char** argv) try { CommandLine::Menu menu; CommandLine::Argument* arg; menu.set_help_header ("digifits - convert dspsr input to PSRFITS search mode output"); menu.set_version ("digifits " + tostring(dsp::version) + " <" + FTransform::get_library() + ">"); config->add_options (menu); // Need to rename default threading option due to conflict // with original digifil -t (time average) setting. arg = menu.find("t"); arg->set_short_name('\0'); arg->set_long_name("threads"); arg->set_type("nthread"); menu.add ("\n" "Source options:"); arg = menu.add (config->dispersion_measure, 'D', "dm"); arg->set_help (" set the dispersion measure"); menu.add ("\n" "Processing options:"); arg = menu.add (config->block_size, 'B', "MB"); arg->set_help ("block size in megabytes"); string ram_limit; arg = menu.add (ram_limit, 'U', "MB"); arg->set_help ("upper limit on RAM usage"); arg->set_long_help ("specify the floating point number of megabytes; e.g. -U 256 \n"); arg = menu.add (&config->filterbank, &dsp::Filterbank::Config::set_freq_res, 'x', "nfft"); arg->set_help ("set backward FFT length in voltage filterbank"); arg = menu.add (config->coherent_dedisp, "do_dedisp", "bool"); arg->set_help ("enable coherent dedispersion (default: false)"); arg = menu.add (config->rescale_constant, 'c'); arg->set_help ("keep offset and scale constant"); arg = menu.add (config->rescale_seconds, 'I', "secs"); arg->set_help ("rescale interval in seconds"); menu.add ("\n" "Output options:"); arg = menu.add (config->tsamp, 't', "tsamp"); arg->set_help ("integration time (s) per output sample (default=64mus)"); arg = menu.add (config->npol, 'p', "npol"); arg->set_help ("output 1 (Intensity), 2 (AABB), or 4 (Coherence) products"); arg = menu.add (config->nbits, 'b', "bits"); arg->set_help ("number of bits per sample output to file [1,2,4,8]"); arg = menu.add (config->filterbank, 'F', "nchan[:D]"); arg->set_help ("create a filterbank (voltages only)"); arg->set_long_help ("Specify number of filterbank channels; e.g. -F 256\n" "Select coherently dedispersing filterbank with -F 256:D\n" "Set leakage reduction factor with -F 256:<N>\n"); arg = menu.add (config->nsblk, "nsblk", "N"); arg->set_help ("output block size in samples (default=2048)"); arg = menu.add (config->integration_length, 'L', "seconds"); arg->set_help ("set maximum file length"); arg = menu.add (config->dedisperse, 'K'); arg->set_help ("remove inter-channel dispersion delays"); //arg = menu.add (config->fscrunch_factor, 'f', "nchan"); //arg->set_help ("decimate in frequency"); arg = menu.add (config->output_filename, 'o', "file"); arg->set_help ("output filename"); //bool revert = false; //arg = menu.add (revert, 'p'); //arg->set_help ("revert to FPT order"); menu.parse (argc, argv); if (!ram_limit.empty()) { double MB = fromstring<double> (ram_limit); config->set_maximum_RAM (uint64_t( MB * 1024.0 * 1024.0 )); } //if (revert) // config->order = dsp::TimeSeries::OrderFPT; } catch (Error& error) { cerr << error << endl; exit (-1); } catch (std::exception& error) { cerr << error.what() << endl; exit (-1); }
void paz::add_options (CommandLine::Menu& menu) { CommandLine::Argument* arg = 0; // backward compatibility: -u == -O menu.add( new CommandLine::Alias( menu.find("O"), 'u' ) ); menu.add ("\n" "Manual zapping options:"); arg = menu.add (zero_intersection, 'I'); arg->set_help ("Zero weight the intersection of -[wW] and -[zZk]"); arg = menu.add (killfile, 'k', "filename"); arg->set_help ("Zero weight chans listed in this kill file"); arg = menu.add (this, &paz::range_bins_to_zap, 'B', "\"a b\""); arg->set_help ("Zap pulse phase bins between a and b inclusive"); arg = menu.add (this, &paz::add_chans_to_zero, 'z', "\"a b c ...\""); arg->set_help ("Zero weight these particular channels"); arg = menu.add (this, &paz::range_chans_to_zero, 'Z', "\"a b\""); arg->set_help ("Zero weight chans between a & b inclusive"); arg = menu.add (this, &paz::add_freqs_to_zero, 'f', "\"a b c ...\""); arg->set_help ("Zero weight channels with these frequencies (MHz)"); arg = menu.add (this, &paz::range_freqs_to_zero, 'F', "\"a b\""); arg->set_help ("Zero weight this frequency range, inclusive (MHz)"); arg = menu.add (this, &paz::add_subs_no_delete, 'x', "\"a b c ...\""); arg->set_help ("Delete all sub-integrations except these"); arg = menu.add (this, &paz::range_subs_no_delete, 'X', "\"a b\""); arg->set_help ("Delete all sub-ints except a to b inclusive"); arg = menu.add (edge_zap_percent, 'E', "percent"); arg->set_help ("Zero weight this much of each band edge"); arg = menu.add (this, &paz::add_subs_to_delete, 's', "\"a b c ...\""); arg->set_help ("Delete these sub-integrations"); arg = menu.add (this, &paz::range_subs_to_delete, 'S', "\"a b\""); arg->set_help ("Delete sub-ints between a & b inclusive"); arg = menu.add (this, &paz::add_subs_to_zero, 'w', "\"a b c ...\""); arg->set_help ("Zero weight these sub-integrations"); arg = menu.add (this, &paz::range_subs_to_zero, 'W', "\"a b\""); arg->set_help ("Zero weight sub-ints between a & b inclusive"); arg = menu.add (this, &paz::parse_periodic_zap, 'p', "\"p i\""); arg->set_help ("Interpolate over every p-th phase bin, start at i"); arg = menu.add (pol_to_delete, "poln", "0/1"); arg->set_help ("Delete the specified polarization"); menu.add ("\n" "Automatic zapping algorithms:"); arg = menu.add (median_zap, 'r'); arg->set_help ("Zap channels using median smoothed difference"); arg = menu.add (median_zap_window, 'R', "size"); arg->set_help ("Set the size of the median smoothing window"); arg = menu.add (this, &paz::add_subints_to_mow, 'l', "subint"); arg->set_help ("Mow the lawn of the specified subint"); arg = menu.add (mow_all_subints, 'L'); arg->set_help ("Mow the lawn of all subints"); arg = menu.add (simple, 'd'); arg->set_help ("Zero weight chans using mean offset rejection"); arg = menu.add (ston_cutoff, 'C', "cutoff"); arg->set_help ("Zero weight chans based on S/N (std optional)"); arg = menu.add (std_filename, 'P', "stdfile"); arg->set_help ("Use this standard profile"); arg = menu.add (dropout_sigma, 'o', "cutoff"); arg->set_help ("Zero weight subints with negative dropouts"); arg = menu.add (eightBinZap, '8'); arg->set_help ("Fix ATNF WBCORR 8 bin problem (see also -p)"); menu.add ("\n" "The format of the kill file used with the -k option is simply\n" "a list of channel numbers, separated by white space\n" "\n" "The cutoff S/N value used with -C is largely arbitrary. You will\n" "need to experiment to find the best value for your archives"); }
void psrspa::add_options ( CommandLine::Menu& menu ) { CommandLine::Argument* arg; menu.add ( "" ); menu.add ( "Common options" ); arg = menu.add ( log, 'l' ); arg->set_help ( "Use a logarithmic flux scale" ); arg = menu.add ( bins, 'b', "bins" ); arg->set_help ( "Set the number of all bins" ); arg = menu.add ( dynamic_histogram, 'd' ); arg->set_help ( "Allow dynamic setting of range of histograms" ); menu.add ( "" ); menu.add ( "Scan pulses and find giants - options:" ); arg = menu.add ( this, &psrspa::set_finder, 'a',"algorithm"); arg->set_help ( "Set the algorithm used to find pulses" ); arg->set_long_help ( "\t\tThis is a different implementation of the pulse searching\n" "\t\tAvailable algorithms (name):\n" "\t\t - OnPulseThreshold (above)\n" "\t\t - PeakConsecutive (consecutive)\n" "\t\t - PeakCumulative (cumulative)\n" "\t\t - ProfileWeightStatic (set)\n" "\t\t - ExponentialBaseline (exponential)\n" "\t\t - GaussianBaseline (normal)\n" "\t\t - BaselineWindow (minimum)\n" ); menu.add ( "" ); menu.add ( "Phased resolved histograms" ); arg = menu.add ( this, &psrspa::choose_range, "pr","min,max(,min,max...)" ); arg->set_help ( "Specify phase range (in turns) for the phase resolved algorithms and max amplitude algorithm" ); arg->set_long_help ( "Multiple ranges can be provided, e.g., '0.0,0.1,0.3,0.35' will create two ranges 0.0-0.1 and 0.3-0.35" ); arg = menu.add ( create_flux, "hf"); arg->set_help ( "Create phase resolved histogram of flux" ); arg = menu.add ( create_polar_degree, "hd"); arg->set_help ( "Create phase resolved histogram of polarisation degree" ); arg = menu.add ( create_polar_angle, "ha"); arg->set_help ( "Create phase resolved histogram of polarisation angle" ); arg = menu.add ( find_max_amp_in_range, "fm"); arg->set_help ( "Find maximum amplitude in the given phase range as provided by -pr" ); arg = menu.add ( flux_pr_bins, "hfb", "bins" ); arg->set_help ( "Set the number of phase resolved flux bins" ); arg = menu.add ( polar_degree_bins, "hdb", "bins" ); arg->set_help ( "Set the number of polarisation degree bins" ); arg = menu.add ( polar_angle_bins, "hab", "bins" ); arg->set_help ( "Set the number of polarisation angle bins" ); arg = menu.add ( this, &psrspa::choose_bscrunch, "bl", "max_bscrunch" ); arg->set_help ( "When searching for maximum amplitude in the given phase range, perform calculations\n" "also for bscrunched profiles, with the given maximum bscrunch factor" ); menu.add ( "" ); menu.add ( "Output of the histograms" ); arg = menu.add ( prefix, "pfix","prefix" ); arg->set_help ( "Write files with this prefix" ); arg = menu.add ( ext, 'e', "extension" ); arg->set_help ( "Write files with this extension" ); arg = menu.add ( path, 'O', "path" ); arg->set_help ( "Write files in this location" ); arg = menu.add ( binary_output, "bo" ); arg->set_help ( "write the phase resolved histograms in binary format" ); }