本文整理汇总了C++中reference::To::dedisperse方法的典型用法代码示例。如果您正苦于以下问题:C++ To::dedisperse方法的具体用法?C++ To::dedisperse怎么用?C++ To::dedisperse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reference::To
的用法示例。
在下文中一共展示了To::dedisperse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finalize
void psradd::finalize ()
{
if (log_file)
fprintf (log_file, "\n");
if (reset_total)
return;
if (auto_add && auto_add_tscrunch)
{
if (verbose) cerr << "psradd: Auto add - tscrunching last "
<< total->integration_length()
<< " seconds of data." << endl;
total->tscrunch();
}
if (!time_direction)
{
// dedisperse to the new centre frequency
if (total->get_dedispersed())
total->dedisperse();
// correct Faraday rotation to the new centre frequency
if (total->get_faraday_corrected())
total->defaraday();
// re-compute the phase predictor to the new centre frequency
if (total->has_model() && total->has_ephemeris())
total->update_model ();
}
if (!testing)
{
if (verbose)
cerr << "psradd: Unloading archive: '" << unload_name << "'" << endl;
total->unload (unload_name);
}
}
示例2: main
int main (int argc, char *argv[]) try {
bool verbose = false;
char* metafile = 0;
string ulpath;
bool save = false;
string ext;
bool tscr = false;
int tscr_fac = 0;
bool fscr = false;
int fscr_fac = 0;
bool bscr = false;
int bscr_fac = 0;
bool newdm = false;
double dm = 0.0;
bool scattered_power_correction = false;
bool defaraday = false;
bool newrm = false;
double rm = 0.0;
bool reset_weights = false;
float new_weight = 1.0;
float smear_dc = 0.0;
bool rotate = false;
double rphase = 0.0;
bool dedisperse = false;
bool dededisperse = false;
bool pscr = false;
bool invint = false;
bool stokesify = false;
bool unstokesify = false;
bool flipsb = false;
bool flip_freq = false;
double flip_freq_mhz = 0.0;
Pulsar::Parameters* new_eph = 0;
string command = "pam";
char* archive_class = 0;
int new_nchn = 0;
int new_nsub = 0;
int new_nbin = 0;
float tsub = 0.0;
bool circ = false;
bool lin = false;
unsigned ronsub = 0;
bool cbppo = false;
bool cbpao = false;
bool cblpo = false;
bool cblao = false;
int subint_extract_start = -1;
int subint_extract_end = -1;
bool new_cfreq = false;
double new_fr = 0.0;
Signal::Source new_type = Signal::Unknown;
string instrument;
bool reverse_freqs = false;
string site;
string name;
float mult = -1.0;
double new_folding_period = -1.0;
bool update_dm_from_eph = false;
double aux_rm = 0.0;
Reference::To<Pulsar::IntegrationOrder> myio;
Reference::To<Pulsar::Receiver> install_receiver;
Pulsar::ReflectStokes reflections;
int c = 0;
const int TYPE = 1208;
const int INST = 1209;
const int REVERSE_FREQS = 1210;
const int SITE = 1211;
const int NAME = 1212;
//.........这里部分代码省略.........
示例3: main
int main(int argc, char *argv[]) {
/* Process any args */
int opt=0;
int verb=0;
string expression;
while ((opt=getopt(argc,argv,"hve:E:"))!=-1) {
switch (opt) {
case 'v':
verb++;
Archive::set_verbosity(verb);
break;
case 'e':
output_ext.assign(optarg);
break;
case 'E':
expression = optarg;
break;
case 'h':
default:
usage();
usage_interactive();
exit(0);
break;
}
}
if (optind==argc) {
usage();
cerr << PROG ": No filename given" << endl;
exit(-1);
}
/* Load file */
string filename = argv[optind];
Reference::To<Archive> orig_arch = Archive::load(filename);
Reference::To<Archive> arch = orig_arch->clone();
arch->dedisperse();
arch->remove_baseline();
double bw = arch->get_bandwidth();
string output_filename = replace_extension(filename, output_ext);
string psrsh_filename = replace_extension(filename,"psh");
// Create profile plots
Reference::To<Archive> tot_arch=NULL,pf_arch=NULL,pt_arch=NULL;
ProfilePlot *totplot=NULL;
PhaseVsFrequency *pfplot=NULL;
PhaseVsTime *ptplot=NULL;
int totplot_id;
totplot = new ProfilePlot;
pfplot = new PhaseVsFrequency;
ptplot= new PhaseVsTime;
// Create window and subdivide
totplot_id = cpgopen("/xs");
cpgpap(0.0,1.5);
cpgsubp(1,3);
// Create Dynamic Spectrum Plot
DynamicBaselineSpectrumPlot *dsplot = new DynamicBaselineSpectrumPlot;
if (!expression.empty())
dsplot->configure("exp="+expression);
else
dsplot->configure("var=1");
dsplot->set_reuse_baseline();
int dsplot_id = cpgopen("/xs");
if (dsplot_id<=0) {
cerr << PROG ": PGPLOT xwindows device open failed, exiting." << endl;
exit(1);
}
cpgask(0);
/* Input loop */
char ch='\0';
enum cursor_type curs=both_cursor;
float x0=0.0, y0=0.0, x1, y1;
int click=0, mode=0;
int pol=0,izap=0;
bool redraw=true, var=true, log=false, resum=true,remove_baseline=false,method=false;
struct zap_range zap;
vector<struct zap_range> zap_list;
do {
/* Redraw the plot if necessary */
if (redraw) {
char conf[256];
sprintf(conf, "above:c=$file\\n%s %s, %s scale, %s baseline, pol %d.",
method ? "total" : "off-pulse" ,
var ? "variance" : "mean",
log ? "log" : "linear",
remove_baseline ? "variable" : "constant",
//.........这里部分代码省略.........
示例4: main
int main(int argc, char* argv[]) try
{
if (argc < 2) {
usage();
return EXIT_SUCCESS;
}
int gotc = 0;
while ((gotc = getopt(argc, argv, "hvV")) != -1) {
switch (gotc) {
case 'h':
usage();
return EXIT_SUCCESS;
case 'V':
Pulsar::Archive::set_verbosity(3);
break;
case 'v':
Pulsar::Archive::set_verbosity(2);
break;
}
}
if (optind >= argc)
{
cerr << "pazi: please specify filename" << endl;
return -1;
}
string filename = argv[optind];
string extension = filename.substr(filename.length() - 2, 2);
if (extension == "rf")
extension = "rz";
else if (extension == "cf")
extension = "cz";
else
extension = "pazi";
string write_filename = filename + ".";
write_filename += extension;
cerr << "pazi: loading data" << endl;
base_archive = Archive::load(filename);
if (base_archive->get_npol() == 4)
{
original_state = base_archive->get_state();
base_archive->convert_state( Signal::Stokes );
}
backup_archive = base_archive->clone();
cerr << "pazi: making fscrunched clone" << endl;
mod_archive = base_archive->clone();
mod_archive->pscrunch();
mod_archive->remove_baseline();
mod_archive->dedisperse();
mod_archive->fscrunch();
scrunched_archive = mod_archive->clone();
scrunched_archive->tscrunch();
ranges.second = get_max_value(base_archive, plot_type);
positive_direction = base_archive->get_bandwidth() < 0.0;
time_orig_plot = factory.construct("time");
time_mod_plot = factory.construct("time");
time_fui = time_mod_plot->get_frame_interface();
freq_orig_plot = factory.construct("freq");
freq_mod_plot = factory.construct("freq");
freq_fui = freq_mod_plot->get_frame_interface();
total_plot = factory.construct("flux");
total_plot->configure("info=1");
subint_orig_plot = new ProfilePlot;
subint_mod_plot = new ProfilePlot;
subint_fui = subint_mod_plot->get_frame_interface();
subint_orig_plot->configure("info=1");
subint_mod_plot->configure("info=1");
unsigned window = 0;
char device [8];
for (unsigned i=0; i<2; i++) do {
window ++;
snprintf (device, 8, "%u/XS", window);
}
while ( cpgopen (device) < 0 );
cpgask(0);
cerr << endl << "Total S/N = " <<
scrunched_archive->get_Profile(0,0,0)->snr() << endl << endl;
total_plot->plot(scrunched_archive);
cpgslct(1);
time_orig_plot->plot(mod_archive);
//.........这里部分代码省略.........