本文整理汇总了C++中reference::To::get_npol方法的典型用法代码示例。如果您正苦于以下问题:C++ To::get_npol方法的具体用法?C++ To::get_npol怎么用?C++ To::get_npol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类reference::To
的用法示例。
在下文中一共展示了To::get_npol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void setup (Integration* subint, unsigned ichan)
{
Pulsar::MoreProfiles* more = NULL;
unsigned npol = subint->get_npol();
if (auxiliary)
{
more = subint->get_Profile (0,ichan)->get<Pulsar::MoreProfiles>();
npol = more->get_size();
}
try {
vector<unsigned> pols = ::indeces (npol, indeces);
profiles.resize (pols.size());
for (unsigned ipol=0; ipol < pols.size(); ipol++)
{
if (more)
profiles[ipol] = more->get_Profile( pols[ipol] );
else
profiles[ipol] = subint->get_Profile ( pols[ipol],ichan);
}
}
catch (...)
{
// if parsing indeces fails, then assume that letter codes are used
Reference::To<const PolnProfile> profile = new_Stokes (subint, ichan);
profiles.resize (indeces.length());
for (unsigned ipol=0; ipol < indeces.length(); ipol++)
profiles[ipol] = new_Profile (profile, indeces[ipol]);
}
}
示例2: main
//.........这里部分代码省略.........
dsplot->configure("var=1");
else
dsplot->configure("var=0");
click = 0;
continue;
}
// Toggle dynamic spectrum
if (ch==CMD_METHOD) {
method = !method;
redraw = true;
if (method)
dsplot->configure("method=1");
else
dsplot->configure("method=0");
click = 0;
continue;
}
/* toggle log scale */
if (ch==CMD_LOG) {
log = !log;
redraw = true;
if (log)
dsplot->configure("cmap:log=1");
else
dsplot->configure("cmap:log=0");
click = 0;
continue;
}
/* Flip through polarizations */
if (ch==CMD_POL) {
pol = (pol + 1) % arch->get_npol();
char conf[256];
sprintf(conf, "pol=%d", pol);
dsplot->configure(conf);
redraw = true;
click = 0;
continue;
}
/* Unset zoom */
if (ch==CMD_UNZOOM) {
dsplot->configure("srange=(-1,-1)");
dsplot->configure("y:win=(0,0)");
pfplot->configure("y:win=(0,0)");
ptplot->configure("y:win=(0,0)");
redraw = true;
click = 0;
izap=zap_list.size();
continue;
}
/* Save file */
if (ch==CMD_SAVE || ch==CMD_SAVE_QUIT) {
/* Apply zaps to original file */
for (unsigned i=0; i<zap_list.size(); i++) {
zap = zap_list[i];
apply_zap_range(orig_arch, &zap);
}
cout << "Unloading '" << output_filename << "'..." << endl;
orig_arch->unload(output_filename);
click = 0;
if (ch==CMD_SAVE_QUIT) { ch=CMD_QUIT; }
continue;
示例3: main
//.........这里部分代码省略.........
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;
}
示例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);
//.........这里部分代码省略.........