当前位置: 首页>>代码示例>>C++>>正文


C++ Phase::fracturns方法代码示例

本文整理汇总了C++中Phase::fracturns方法的典型用法代码示例。如果您正苦于以下问题:C++ Phase::fracturns方法的具体用法?C++ Phase::fracturns怎么用?C++ Phase::fracturns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phase的用法示例。


在下文中一共展示了Phase::fracturns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Error


//.........这里部分代码省略.........
		   "period(epoch=%s)=%lf", epoch.printdays(5).c_str(),
		   integ->get_folding_period() );

    if (integ->get_folding_period() < 1.0e-3)
      warning << "Pulsar::FITSArchive::load_Integration folding_period=" 
	      << integ->get_folding_period() << " is less than 1ms" << endl;

    else if (verbose > 2)
      cerr << "Pulsar::FITSArchive::load_Integration folding_period = "
      	   << integ->get_folding_period () << endl;

    if (duration && correct_epoch_phase)
    {

      if (verbose > 2)
	cerr << "Pulsar::FITSArchive::load_Integration correcting epoch phase"
	     << endl;

      Phase reference_phs = 0.0;

      if (phase_match_start_time)
      {
	// Correct epoch such that its phase equals that of the start time
	if (verbose > 2)
	  cerr << "Pulsar::FITSArchive::load_Integration matching phase(start)"
	       << endl;

	reference_phs = hdr_model->phase(hdr_ext->get_start_time());
      }

      Phase off_phs = hdr_model->phase(epoch);
      Phase dphase  = off_phs - reference_phs;
      
      double dtime = dphase.fracturns() * integ->get_folding_period();
      epoch -= dtime;
      integ->set_epoch (epoch);

      if (verbose > 2)
      {
      	cerr << "Pulsar::FITSArchive::load_Integration row=" << row <<
	  "\n  PRED_PHS=" << predicted_phase;

	if (phase_match_start_time)
	  cerr << "\n  reference epoch=" 
	       << hdr_ext->get_start_time().printdays(13);

	cerr <<
	  "\n  reference phase=" << reference_phs <<
	  "\n      input phase=" << off_phs <<
	  "\n     phase offset=" << dphase << " = " << dtime << "s" 
	  "\n     subint epoch=" << epoch.printdays(13) << 
	  "\n     subint phase=" << hdr_model->phase(epoch) << endl;
      }
    }
  }
  else
  {

    /* *******************************************************************

       METHOD 2: folding period defined by CAL_FREQ in primary header

       ******************************************************************* */

    CalInfoExtension* calinfo = get<CalInfoExtension>();
    if (calinfo && calinfo->cal_frequency > 0.0)
开发者ID:lbaehren,项目名称:lofarsoft,代码行数:67,代码来源:load_Integration.C

示例2: Error

void dsp::Archiver::set (Pulsar::Archive* archive, const PhaseSeries* phase)
try
{
  if (verbose > 2)
    cerr << "dsp::Archiver::set Pulsar::Archive" << endl;

  if (!archive)
    throw Error (InvalidParam, "dsp::Archiver::set Pulsar::Archive",
        	 "no Archive");

  if (!phase)
    throw Error (InvalidParam, "dsp::Archiver::set Pulsar::Archive",
        	 "no PhaseSeries");

  const unsigned npol  = get_npol (phase);
  const unsigned nchan = phase->get_nchan();
  const unsigned nbin  = phase->get_nbin();
  const unsigned nsub  = 1;

  if (verbose > 2)
    cerr << "dsp::Archiver::set Pulsar::Archive nsub=" << nsub 
         << " npol=" << npol << " nchan=" << nchan 
         << " nbin=" << nbin << " fourth=" << fourth_moments << endl;

  archive-> resize (nsub, npol, nchan, nbin);

  Pulsar::FITSHdrExtension* ext;
  ext = archive->get<Pulsar::FITSHdrExtension>();
  
  if (ext)
  {
    if (verbose > 2)
      cerr << "dsp::Archiver::set Pulsar::Archive FITSHdrExtension" << endl;

    // Make sure the start time is aligned with pulse phase zero
    // as this is what the PSRFITS format expects.

    MJD initial = phase->get_start_time();

    if (phase->has_folding_predictor())
    {
      Phase inphs = phase->get_folding_predictor()->phase(initial);
      double dtime = inphs.fracturns() * phase->get_folding_period();
      initial -= dtime;
    }

    ext->set_start_time (initial);

    // In keeping with tradition, I'll set this to a value that should
    // work in most places for the next 50 years or so ;)

    ext->set_coordmode("J2000");

    // Set the ASCII date stamp from the system clock (in UTC)

    time_t thetime;
    time(&thetime);
    string time_str = asctime(gmtime(&thetime));

    // Cut off the line feed character
    time_str = time_str.substr(0,time_str.length() - 1);

    ext->set_date_str(time_str);
  }

  archive-> set_telescope ( phase->get_telescope() );
  archive-> set_type ( phase->get_type() );

  switch (phase->get_state())
  {
  case Signal::NthPower:
  case Signal::PP_State:
  case Signal::QQ_State:
    archive->set_state (Signal::Intensity);
    break;
  
  case Signal::FourthMoment:
    archive->set_state (Signal::Stokes);
    break;

  default:
    archive-> set_state ( phase->get_state() );
  }

  archive-> set_scale ( Signal::FluxDensity );

  if (verbose > 2)
    cerr << "dsp::Archiver::set Archive source=" << phase->get_source()
         << "\n  coord=" << phase->get_coordinates()
         << "\n  bw=" << phase->get_bandwidth()
         << "\n  freq=" << phase->get_centre_frequency () << endl;

  archive-> set_source ( phase->get_source() );
  archive-> set_coordinates ( phase->get_coordinates() );
  archive-> set_bandwidth ( phase->get_bandwidth() );
  archive-> set_centre_frequency ( phase->get_centre_frequency() );
  archive-> set_dispersion_measure ( phase->get_dispersion_measure() );

  archive-> set_dedispersed( archive_dedispersed );
  archive-> set_faraday_corrected (false);
//.........这里部分代码省略.........
开发者ID:vincentvillani,项目名称:DSPSR,代码行数:101,代码来源:Archiver.C


注:本文中的Phase::fracturns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。