Skip to content
4 changes: 2 additions & 2 deletions src/multio/action/statistics-mtg2/OperationWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ eckit::DateTime yyyymmdd_hhmmss2DateTime(uint64_t yyyymmdd, uint64_t hhmmss) {

OperationWindow make_window(const std::unique_ptr<PeriodUpdater>& periodUpdater, const StatisticsConfiguration& cfg) {
eckit::DateTime epochPoint{cfg.epoch()};
eckit::DateTime startPoint{periodUpdater->computeWinStartTime(cfg.winStart())};
eckit::DateTime creationPoint{periodUpdater->computeWinCreationTime(cfg.winStart())};
eckit::DateTime startPoint{periodUpdater->computeWinStartTime(cfg.curr())};
eckit::DateTime creationPoint{periodUpdater->computeWinCreationTime(cfg.curr())};
eckit::DateTime endPoint{periodUpdater->computeWinEndTime(startPoint)};
long windowType = 0;
if (cfg.options().windowType() == "forward-offset") {
Expand Down
2 changes: 1 addition & 1 deletion src/multio/action/statistics-mtg2/Operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ std::vector<std::unique_ptr<Operation>> make_operations(const std::vector<std::s
std::vector<std::unique_ptr<Operation>> stats;
for (const auto& op : opNames) {
stats.push_back(make_operation<Precision>(op, msg.size(), IOmanager, win, cfg));
if (cfg.options().solver_send_initial_condition()) {
if (cfg.options().initialConditionPresent()) {
stats.back()->init(msg.payload().data(), msg.size(), msg, cfg);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/multio/action/statistics-mtg2/Statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Statistics::Statistics(const ComponentConfiguration& compConf) :
ChainedAction{compConf},
needRestart_{false},
lastDateTime_{""},
opt_{compConf},
opt_{compConf.parsedConfig().getSubConfiguration("options")},
operations_{compConf.parsedConfig().getStringVector("operations")},
outputFrequency_{compConf.parsedConfig().getString("output-frequency")},
paramMapping_{StatisticsParamMapping::makeStatisticsParamMapping()},
Expand Down Expand Up @@ -387,7 +387,7 @@ void Statistics::executeImpl(message::Message msg) {
// This can happen when the solver is sending the initial condition
// and and the same point is already present in the restart
auto& ts = *(stat->second);
if (cfg.curr() == ts.cwin().currPoint() && opt_.solver_send_initial_condition()) {
if (cfg.curr() == ts.cwin().currPoint() && opt_.initialConditionPresent()) {
return;
}

Expand Down
10 changes: 5 additions & 5 deletions src/multio/action/statistics-mtg2/SynopticCollection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ SynopticCollection::SynopticCollection(const std::string& operation, const messa
filter_{op_[0] == op_[1] ? make_filter(op_[1], cfg) : make_filter(op_[1], filterConf.at(op_[0]), cfg)} //,
// statistics_{make_operations(op_[2], msg, filter_->size(), IOmanager, win, cfg)}
{
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** SynopticCollection standard constructor "
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** SynopticCollection standard constructor "
<< std::endl;
};

Expand All @@ -132,7 +132,7 @@ SynopticCollection::SynopticCollection(const std::string& operation, const std::
filter_{op_[0] == op_[1] ? make_filter(op_[1], cfg) : make_filter(op_[1], filterConf.at(op_[0]), cfg)} //,
// statistics_{load_operations(op_[2], precision, filter_->size(), IOmanager, win, cfg)}
{
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** SynopticCollection load constructor " << std::endl;
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** SynopticCollection load constructor " << std::endl;
};


Expand All @@ -144,7 +144,7 @@ size_t SynopticCollection::size() const {


void SynopticCollection::resetWindow(const message::Message& msg, const StatisticsConfiguration& cfg) {
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** SynopticCollection::updateWindow " << std::endl;
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** SynopticCollection::updateWindow " << std::endl;
for (auto& stat : statistics_) {
// TODO: Just set to zero all the data of the window
// stat.resetWindow();
Expand All @@ -161,7 +161,7 @@ void SynopticCollection::resetWindow(const message::Message& msg, const Statisti


void SynopticCollection::updateData(const message::Message& msg, const StatisticsConfiguration& cfg) {
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** SynopticCollection::updateData " << std::endl;
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** SynopticCollection::updateData " << std::endl;
size_t key;
if (filter_->match(msg, cfg, key)) {
// TODO: add profiling code
Expand All @@ -181,7 +181,7 @@ void SynopticCollection::fillMetadata(size_t idx, message::Metadata& metadata) c


void SynopticCollection::dump(std::shared_ptr<StatisticsIO>& IOmanager, const StatisticsConfiguration& cfg) const {
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** SynopticCollection::dump " << std::endl;
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** SynopticCollection::dump " << std::endl;
std::ostringstream os;
size_t cnt = 0;
for (auto& stat : statistics_) {
Expand Down
6 changes: 3 additions & 3 deletions src/multio/action/statistics-mtg2/TemporalStatistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void TemporalStatistics::dump(std::shared_ptr<StatisticsIO>& IOmanager, const St
}

void TemporalStatistics::updateData(message::Message& msg, const StatisticsConfiguration& cfg) {
LOG_DEBUG_LIB(multio::LibMultio) << cfg.logPrefix() << " *** Update Data" << std::endl;
LOG_DEBUG_LIB(multio::LibMultio) << cfg.options().logPrefix() << " *** Update Data" << std::endl;
window_.updateData(currentDateTime(msg, cfg));
for (auto& stat : statistics_) {
// Truncation is always present when we are dealing with Spherical Harmonics
Expand All @@ -86,7 +86,7 @@ void TemporalStatistics::updateData(message::Message& msg, const StatisticsConfi
}

void TemporalStatistics::updateWindow(const message::Message& msg, const StatisticsConfiguration& cfg) {
LOG_DEBUG_LIB(multio::LibMultio) << cfg.logPrefix() << " *** Update Window " << std::endl;
LOG_DEBUG_LIB(multio::LibMultio) << cfg.options().logPrefix() << " *** Update Window " << std::endl;
window_.updateWindow(window_.endPoint(), periodUpdater_->updateWinEndTime(window_.endPoint()));
for (auto& stat : statistics_) {
stat->updateWindow(msg.payload().data(), msg.size(), msg, cfg);
Expand All @@ -96,7 +96,7 @@ void TemporalStatistics::updateWindow(const message::Message& msg, const Statist
}

bool TemporalStatistics::isOutsideWindow(message::Message& msg, const StatisticsConfiguration& cfg) {
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.logPrefix() << " *** Check outside Window " << std::endl;
LOG_DEBUG_LIB(::multio::LibMultio) << cfg.options().logPrefix() << " *** Check outside Window " << std::endl;
return !window_.isWithin(currentDateTime(msg, cfg));
}

Expand Down
Loading
Loading