本文整理汇总了C++中MJD::printdays方法的典型用法代码示例。如果您正苦于以下问题:C++ MJD::printdays方法的具体用法?C++ MJD::printdays怎么用?C++ MJD::printdays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MJD
的用法示例。
在下文中一共展示了MJD::printdays方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: error
//! Return the phase, given the epoch
Phase Tempo2::Predictor::phase (const MJD& t) const
{
if (verbose)
cerr << "Tempo2::Predictor::phase epoch=" << t << " frequency="
<< observing_frequency << endl;
if (observing_frequency <= 0)
Error error (InvalidState, "Tempo2::Predictor::phase",
"observing_frequency=%lf", (double) observing_frequency);
long double p = T2Predictor_GetPhase ( &predictor, from_MJD (t),
observing_frequency );
if (ChebyModelSet_OutOfRange)
throw Error (InvalidParam, "Tempo2::Predictor::phase",
"epoch %s not spanned by ChebyModelSet",
t.printdays(20).c_str());
if (!finite(p)) {
Error error (InvalidState, "Tempo2::Predictor::phase",
"T2Predictor_GetPhase result = ");
error << p;
throw error;
}
return to_Phase( p );
}
示例2: Error
//! Return the spin frequency, given the epoch
long double Tempo2::Predictor::frequency (const MJD& t) const
{
long double f = T2Predictor_GetFrequency (&predictor, from_MJD (t),
observing_frequency);
if (ChebyModelSet_OutOfRange)
throw Error (InvalidParam, "Tempo2::Predictor::frequency",
"epoch %s not spanned by ChebyModelSet",
t.printdays(20).c_str());
return f;
}
示例3: if
MJD dsp::LoadToFold::parse_epoch (const std::string& epoch_string)
{
MJD epoch;
if (epoch_string == "start")
{
epoch = manager->get_info()->get_start_time();
epoch += manager->get_input()->tell_seconds();
if (Operation::verbose)
cerr << "dsp::LoadToFold::parse reference epoch=start_time="
<< epoch.printdays(13) << endl;
}
else if (!epoch_string.empty())
{
epoch = MJD( epoch_string );
if (Operation::verbose)
cerr << "dsp::LoadToFold::parse reference epoch="
<< epoch.printdays(13) << endl;
}
return epoch;
}
示例4: setMJD
void qt_MJD::setMJD (const MJD& mjd)
{
value.setText (mjd.printdays(val_precision).c_str());
valset = mjd;
}
示例5: Error
//.........这里部分代码省略.........
// Set the duration of the integration
colnum = 0;
fits_get_colnum (fptr, CASEINSEN, "TSUBINT", &colnum, &status);
double duration = 0.0;
fits_read_col (fptr, TDOUBLE, colnum, row, 1, 1, &nulldouble,
&duration, &initflag, &status);
integ->set_duration (duration);
// Set the start time of the integration
initflag = 0;
colnum = 0;
fits_get_colnum (fptr, CASEINSEN, "OFFS_SUB", &colnum, &status);
double time = 0.0;
fits_read_col (fptr, TDOUBLE, colnum, row, 1, 1, &nulldouble,
&time, &initflag, &status);
if (status != 0)
throw FITSError (status, "FITSArchive::load_Integration",
"fits_read_col OFFS_SUB");
MJD epoch = hdr_ext->get_start_time() + time;
if (verbose > 2)
cerr << "Pulsar::FITSArchive::load_Integration"
" header epoch=" << hdr_ext->get_start_time().printdays(13) << "\n "
" offset=" << time << "s epoch=" << epoch.printdays(13) << endl;
// Set a preliminary epoch to avoid problems loading the polyco
integ->set_epoch (epoch);
// Set the folding period to 0 until one of three possible methods succeeds
integ->set_folding_period (0.0);
/* **********************************************************************
METHOD 1: folding period defined by a pulse phase model
********************************************************************** */
if (hdr_model)
{
// Set the folding period, using the polyco from the file header
// This was taken out of the condition clause below because period
// wasn't set when TSUB was 0
integ->set_folding_period (1.0 / hdr_model->frequency(epoch));
if (integ->get_folding_period() <= 0.0)
throw Error( InvalidState, "Pulsar::FITSArchive::load_Integration",
"header polyco/predictor corrupted; "
"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)
示例6: double
bool dsp::PhaseSeries::mixable (const Observation& obs, unsigned nbin,
int64_t istart, int64_t fold_ndat)
{
MJD obsStart = obs.get_start_time() + double (istart) / obs.get_rate();
if (verbose)
cerr << "PhaseSeries::mixable start mix=" << obsStart.printdays(8)
<< " cur=" << get_start_time().printdays(8) << endl;
MJD obsEnd;
// if fold_ndat is not specified, fold to the end of the Observation
// (works also for special case of adding dsp::PhaseSeriess together;
// where using ndat=nbin would not make sense)
if (fold_ndat == 0)
obsEnd = obs.get_end_time();
else
obsEnd = obsStart + double (fold_ndat) / obs.get_rate();
if (integration_length == 0.0)
{
// the integration is currently empty; prepare for integration
if (verbose)
cerr << "PhaseSeries::mixable reset" << endl;
Observation::operator = (obs);
if (verbose)
cerr << "dsp::PhaseSeries::mixable rate=" << get_rate() << endl;
const TimeSeries* series = dynamic_cast<const TimeSeries*> (&obs);
if (series)
{
if (verbose)
cerr << "dsp::PhaseSeries::mixable calling set_order" << endl;
set_order( series->get_order() );
if (verbose)
cerr << "dsp::PhaseSeries::mixable calling set_zeroed_data" << endl;
set_zeroed_data( series->get_zeroed_data() );
if (get_zeroed_data())
set_hits_nchan( series->get_nchan() );
}
end_time = obsEnd;
start_time = obsStart;
/*
the integration length may be zero only because all of the samples
have been dropped - maintain the record of dropped samples
*/
uint64_t backup_ndat_total = ndat_total;
if (verbose)
cerr << "dsp::PhaseSeries::mixable calling resize(" << nbin << ")" << endl;
resize (nbin);
if (verbose)
cerr << "dsp::PhaseSeries::mixable calling zero()" << endl;
zero ();
ndat_total = backup_ndat_total;
return true;
}
if (!combinable (obs)) {
cerr << "PhaseSeries::mixable differing observations" << endl;
return false;
}
if (get_nbin() != nbin) {
cerr << "PhaseSeries::mixable nbin=" << get_nbin() <<" != "<< nbin <<endl;
return false;
}
end_time = std::max (end_time, obsEnd);
start_time = std::min (start_time, obsStart);
if (verbose)
cerr << "PhaseSeries::mixable combine start=" << start_time.printdays(8)
<< " end=" << end_time.printdays(8) << endl;
return true;
}
示例7: if
void Calibration::SignalPath::disengage_time_variations (const MJD& epoch)
try
{
#ifdef _DEBUG
cerr << "DISENGAGE epoch=" << epoch.printdays(16) << endl;
#endif
if (!time_variations_engaged)
return;
time_variations_engaged = false;
BackendFeed* physical = dynamic_cast<BackendFeed*>( response.get() );
if (!physical)
return;
time.set_value (epoch);
Univariate<Scalar>* zero = 0;
#ifdef _DEBUG
cerr << "before disengage nparam = " << physical->get_nparam() << endl;
#endif
if (gain)
{
#ifdef _DEBUG
cerr << "disengage gain" << endl;
#endif
if (!constant_pulsar_gain)
{
physical->set_gain( zero );
physical->set_gain( gain->estimate() );
}
else if (pcal_gain_chain)
{
pcal_gain_chain->set_constraint( 0, zero );
pcal_gain->set_gain( gain->estimate() );
}
}
if (pcal_gain)
physical->set_gain( pcal_gain->get_gain() );
if (diff_gain)
{
#ifdef _DEBUG
cerr << "disengage diff_gain value=" << diff_gain->estimate() << endl;
#endif
physical->set_diff_gain( zero );
physical->set_diff_gain( diff_gain->estimate() );
}
if (diff_phase)
{
#ifdef _DEBUG
cerr << "disengage diff_phase value=" << diff_phase->estimate() << endl;
#endif
physical->set_diff_phase( zero );
physical->set_diff_phase( diff_phase->estimate() );
}
#ifdef _DEBUG
cerr << "after disengage nparam = " << physical->get_nparam() << endl;
#endif
}
catch (Error& error)
{
throw error += "Calibration::SignalPath::disengage_time_variations";
}