本文整理汇总了C++中MJD::printall方法的典型用法代码示例。如果您正苦于以下问题:C++ MJD::printall方法的具体用法?C++ MJD::printall怎么用?C++ MJD::printall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MJD
的用法示例。
在下文中一共展示了MJD::printall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void dsp::TimeDivide::set_start_time (MJD _start_time)
{
if (start_time == _start_time)
return;
if (Operation::verbose)
cerr << "dsp::TimeDivide::set_start_time start_time="
<< _start_time.printall() << endl;
start_time = _start_time;
start_phase = Pulsar::Phase::zero;
is_valid = false;
if( reference_epoch != MJD::zero )
{
if (Operation::verbose)
cerr << "dsp::TimeDivide::set_start_time set to reference_epoch="
<< reference_epoch.printall() << endl;
start_time = reference_epoch;
}
else if( division_seconds && division_seconds == unsigned(division_seconds) )
{
unsigned integer_seconds = unsigned(division_seconds);
unsigned seconds = start_time.get_secs();
unsigned divisions = seconds / integer_seconds;
start_time = MJD (start_time.intday(), divisions * integer_seconds, 0.0);
if (Operation::verbose)
cerr << "dsp::TimeDivide::set_start_time rounded start_time="
<< _start_time.printall() << endl;
}
}
示例2: Error
std::string dsp::FilenameEpoch::get_filename (const PhaseSeries* data)
{
MJD epoch = data->get_start_time();
if (Observation::verbose)
cerr << "dsp::FilenameEpoch::get_filename epoch="
<< epoch.printall() << endl;
if (integer_seconds)
{
// ensure that the epoch is rounded up into the current division
epoch = data->get_mid_time (false);
DEBUG("dsp::FilenameEpoch::get_filename mid_time=" << epoch.printall());
unsigned seconds = epoch.get_secs();
unsigned divisions = seconds / integer_seconds;
epoch = MJD (epoch.intday(), divisions * integer_seconds, 0.0);
if (Observation::verbose)
cerr << "dsp::FilenameEpoch::get_filename division_start="
<< epoch.printall() << endl;
}
vector<char> fname (FILENAME_MAX);
char* filename = &fname[0];
if (!epoch.datestr( filename, FILENAME_MAX, datestr_pattern.c_str() ))
throw Error (FailedSys, "dsp::PhaseSeriesUnloader::get_filename",
"error MJD::datestr(" + datestr_pattern + ")");
if (report_unload)
cerr << "unloading " << tostring(data->get_integration_length(),2)
<< " seconds: " << filename << endl;
return filename;
}
示例3: Error
//! Seek to a sample close to the specified MJD
void dsp::Input::seek(MJD mjd)
{
int misplacement = 0;
if (mjd+1.0/get_info()->get_rate() < get_info()->get_start_time())
misplacement = -1;
if (mjd-1.0/get_info()->get_rate() > get_info()->get_end_time())
misplacement = 1;
double seek_seconds = (mjd-get_info()->get_start_time()).in_seconds();
if (misplacement)
{
string msg = "The given MJD (" + mjd.printall() + ") is ";
if (misplacement < 0)
msg += "before the start time";
else
msg += "after the end time";
msg += "of the input data "
"(" + get_info()->get_start_time().printall() + "); "
"difference is %lf seconds";
throw Error (InvalidParam, "dsp::Input::seek", msg.c_str(), seek_seconds);
}
double seek_samples = seek_seconds*get_info()->get_rate();
uint64_t actual_seek = 0;
if( seek_samples<0.0 )
actual_seek = 0;
else if( uint64_t(seek_samples) > get_info()->get_ndat() )
actual_seek = get_info()->get_ndat();
else
actual_seek = uint64_t(seek_samples);
if( verbose )
fprintf(stderr,"dsp::Input::seek(MJD) will seek %f = "UI64" samples\n",
seek_samples, actual_seek);
seek( actual_seek, SEEK_SET );
}