本文整理汇总了C++中reference::To::get_nchan方法的典型用法代码示例。如果您正苦于以下问题:C++ To::get_nchan方法的具体用法?C++ To::get_nchan怎么用?C++ To::get_nchan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reference::To
的用法示例。
在下文中一共展示了To::get_nchan方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
Reference::To<Pulsar::Archive> arch;
if (!save)
{
cout << "Changes will not be saved. Use -m, -u or -e to write results to disk"
<< endl;
}
if (stokesify && unstokesify)
{
cerr << "pam: Both -S and --SS options were given. Poln state will not be changed!" << endl;
stokesify = false;
unstokesify = false;
}
int flip_option_count=0;
if (flipsb) flip_option_count++;
if (flip_freq) flip_option_count++;
if (reverse_freqs) flip_option_count++;
if (flip_option_count > 1) {
cerr << "pam: More than one band-flip option was given, exiting." << endl;
exit(-1);
}
for (unsigned i = 0; i < filenames.size(); i++) try
{
if (verbose)
cerr << "Loading " << filenames[i] << endl;
arch = Pulsar::Archive::load(filenames[i]);
if( mult > 0.0 ){
for( unsigned isub=0; isub<arch->get_nsubint();isub++)
for( unsigned ichan=0; ichan<arch->get_nchan();ichan++)
for( unsigned ipol=0; ipol<arch->get_npol();ipol++)
arch->get_Profile(isub,ipol,ichan)->scale( mult );
}
if( new_folding_period > 0.0 ){
Pulsar::counter_drift( arch, new_folding_period, 0.0);
for( unsigned isub=0; isub<arch->get_nsubint();isub++)
arch->get_Integration(isub)->set_folding_period( new_folding_period );
}
if (install_receiver) {
if (verbose)
cerr << "pam: Installing receiver: " << install_receiver->get_name()
<< " in archive" << endl;
arch->add_extension (install_receiver);
}
if (lin || circ) {
Pulsar::Receiver* receiver = arch->get<Pulsar::Receiver>();
if (!receiver)
cerr << "No Receiver Extension in " << filenames[i] << endl;
else {
if (lin) {
receiver->set_basis (Signal::Linear);
cout << "Feed basis set to Linear" << endl;
}
if (circ) {
receiver->set_basis (Signal::Circular);
cout << "Feed basis set to Circular" << endl;
示例2: main
int main (int argc, char** argv)
{ try {
// Pulsar::Archive::verbose = true;
// Error::verbose = true;
// Pulsar::Integration::verbose = true;
int c = 0;
const char* args = "avVF:";
int denoise_fraction = 8;
while ((c = getopt(argc, argv, args)) != -1)
switch (c) {
case 'a':
Pulsar::Archive::agent_report ();
break;
case 'F':
denoise_fraction = atoi(optarg);
break;
case 'V':
Pulsar::Integration::verbose = true;
case 'v':
Pulsar::Archive::verbose = true;
break;
}
vector <string> filenames;
for (int ai=optind; ai<argc; ai++)
dirglob (&filenames, argv[ai]);
for (unsigned ifile=0; ifile < filenames.size(); ifile++) {
cerr << "load archive from " << filenames[ifile] << endl;
Reference::To<Pulsar::Archive> archive;
archive = Pulsar::Archive::load (filenames[ifile]);
cerr << "clone archive for denoise" << endl;
Reference::To<Pulsar::Archive> clone = archive -> clone();
cerr << "tscrunch" << endl;
clone -> tscrunch ();
cerr << "tscrunch from " << archive->get_nsubint()
<< " to " << clone->get_nsubint() << " sub-integrations" << endl;
cerr << "fscrunch" << endl;
clone -> fscrunch ();
cerr << "fscrunch from " << archive->get_nchan()
<< " to " << clone->get_nchan() << " sub-channels" << endl;
cerr << "Denoise " << endl;
clone -> denoise (denoise_fraction);
cerr << "unload denoise.ar" << endl;
clone -> unload ("denoise.ar");
}
}
catch (Error& error) {
cerr << error << endl;
return -1;
}
catch (string& error) {
cerr << error << endl;
return -1;
}
catch (...) {
cerr << "An exception was thrown" << endl;
return -1;
}
return 0;
}