本文整理汇总了C++中MJD::in_seconds方法的典型用法代码示例。如果您正苦于以下问题:C++ MJD::in_seconds方法的具体用法?C++ MJD::in_seconds怎么用?C++ MJD::in_seconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MJD
的用法示例。
在下文中一共展示了MJD::in_seconds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fmod
//! Get the mid-time of the integration
MJD dsp::PhaseSeries::get_mid_time (bool phased) const
{
if (verbose)
{
cerr << "PhaseSeries::get_mid_time start="
<< start_time << " end=" << end_time << endl;
}
MJD midtime = 0.5 * (start_time + end_time);
if (!phased)
return midtime;
if (folding_predictor)
{
// truncate midtime to the nearest pulse phase = reference_phase
Pulsar::Phase phase = folding_predictor->phase(midtime).Floor() + reference_phase;
midtime = folding_predictor->iphase (phase, &midtime);
}
if (folding_period)
{
double phase = reference_phase +
fmod (midtime.in_seconds(), folding_period)/folding_period;
midtime -= phase * folding_period;
}
return midtime;
}
示例2: Error
void dsp::TimeDivide::set_bounds (const Observation* input)
{
observation = input;
double sampling_rate = input->get_rate();
uint64_t input_ndat = input->get_ndat();
MJD input_start = input->get_start_time();
MJD input_end = input->get_end_time();
//////////////////////////////////////////////////////////////////////////
//
// determine the MJD at which to start
//
MJD divide_start = input_start;
if (is_valid)
{
divide_start = std::max (current_end, input_start);
if (Operation::verbose)
cerr << "dsp::TimeDivide::bound continue at"
<< "\n start = " << divide_start
<< "\n current end = " << current_end
<< "\n input start = " << input_start
<< endl;
}
new_division = false;
end_reached = false;
in_next = false;
if (input_end < lower || divide_start + 0.5/sampling_rate > upper)
{
/*
This state occurs when either:
1) this method is first called (no boundaries set)
2) the
*/
if (Operation::verbose)
{
cerr << "dsp::TimeDivide::bound start new division" << endl;
if (input_end < lower)
cerr << " input end = " << input_end << " precedes\n"
" division start = " << lower << endl;
else
cerr << " start = " << divide_start << " is after\n"
" division end = " << upper << endl;
}
new_division = true;
set_boundaries (divide_start + 0.55/sampling_rate);
}
divide_start = std::max (lower, divide_start);
if (Operation::verbose)
cerr << "dsp::TimeDivide::bound start division at"
<< "\n start = " << divide_start
<< "\n division start = " << lower
<< "\n input start = " << input_start
<< endl;
//////////////////////////////////////////////////////////////////////////
//
// determine how far into the current Observation to start
//
MJD offset = divide_start - input_start;
double start_sample = offset.in_seconds() * sampling_rate;
// cerr << "start_sample=" << start_sample << endl;
start_sample = rint (start_sample);
// cerr << "rint(start_sample)=" << start_sample << endl;
assert (start_sample >= 0);
idat_start = (uint64_t) start_sample;
if (Operation::verbose)
cerr << "dsp::TimeDivide::bound start offset " << offset.in_seconds()*1e3
<< " ms (" << idat_start << "pts)" << endl;
if (idat_start >= input_ndat)
{
// The current data end before the start of the current division
if (Operation::verbose)
cerr << "dsp::TimeDivide::bound input ends before division starts"<<endl;
is_valid = false;
return;
}
//////////////////////////////////////////////////////////////////////////
//
// determine how far into the current input TimeSeries to end
//
//.........这里部分代码省略.........
示例3: double_cast
double double_cast (const MJD& mjd)
{
return mjd.in_seconds();
}