Skip to content

Commit

Permalink
Time interpolation: Allow suppressing of missing data messages
Browse files Browse the repository at this point in the history
Allow extra warning messages concerning missing data to be suppressed
when fetching data with time interpolation enabled, because inevitably
there will be a lot of these messages which may clutter the output of
the run.
  • Loading branch information
mpartio committed Apr 2, 2024
1 parent 2d37076 commit 6740996
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion himan-plugins/include/fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class fetcher : public auxiliary_plugin
template <typename T>
std::shared_ptr<himan::info<T>> InterpolateTime(const std::shared_ptr<const plugin_configuration>& conf,
const forecast_time& ftime, const level& lev, const params& pars,
const forecast_type& ftype);
const forecast_type& ftype, bool suppressLogging);

HPFileType FileType(const std::string& theInputFile);
bool itsDoLevelTransform; //<! Default true
Expand Down
16 changes: 8 additions & 8 deletions himan-plugins/source/fetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ shared_ptr<info<T>> fetcher::Fetch(shared_ptr<const plugin_configuration> config
itsLogger.Warning("Not reading from previous forecast as time interpolation is enabled");
}

return InterpolateTime<T>(config, requestedTime, requestedLevel, requestedParams, requestedType);
return InterpolateTime<T>(config, requestedTime, requestedLevel, requestedParams, requestedType, false);
}

shared_ptr<info<T>> ret;
Expand Down Expand Up @@ -228,9 +228,9 @@ shared_ptr<info<T>> fetcher::Fetch(shared_ptr<const plugin_configuration> config
itsLogger.Warning("Not reading from previous forecast as time interpolation is enabled");
}

return InterpolateTime<T>(config, requestedTime, requestedLevel, {requestedParam}, requestedType);
return InterpolateTime<T>(config, requestedTime, requestedLevel, {requestedParam}, requestedType,
suppressLogging);
}

// Check sticky param cache first

shared_ptr<info<T>> ret;
Expand Down Expand Up @@ -1179,7 +1179,7 @@ template void fetcher::RotateVectorComponents<unsigned char>(vector<shared_ptr<i
template <typename T>
shared_ptr<himan::info<T>> fetcher::InterpolateTime(const shared_ptr<const plugin_configuration>& config,
const forecast_time& ftime, const level& lev, const params& pars,
const forecast_type& ftype)
const forecast_type& ftype, bool suppressLogging)
{
itsLogger.Trace("Starting time interpolation");

Expand All @@ -1196,7 +1196,7 @@ shared_ptr<himan::info<T>> fetcher::InterpolateTime(const shared_ptr<const plugi
{
try
{
prev = Fetch<T>(config, curtime, lev, par, ftype, false, false, false, false);
prev = Fetch<T>(config, curtime, lev, par, ftype, false, suppressLogging, false, false);
break;
}
catch (const HPExceptionType& e)
Expand Down Expand Up @@ -1227,7 +1227,7 @@ shared_ptr<himan::info<T>> fetcher::InterpolateTime(const shared_ptr<const plugi

try
{
next = Fetch<T>(config, curtime, lev, par, ftype, false, false, false, false);
next = Fetch<T>(config, curtime, lev, par, ftype, false, suppressLogging, false, false);
break;
}
catch (const HPExceptionType& e)
Expand Down Expand Up @@ -1272,7 +1272,7 @@ shared_ptr<himan::info<T>> fetcher::InterpolateTime(const shared_ptr<const plugi

template shared_ptr<himan::info<double>> fetcher::InterpolateTime<double>(const shared_ptr<const plugin_configuration>&,
const forecast_time&, const level&,
const params&, const forecast_type&);
const params&, const forecast_type&, bool);
template shared_ptr<himan::info<float>> fetcher::InterpolateTime<float>(const shared_ptr<const plugin_configuration>&,
const forecast_time&, const level&,
const params&, const forecast_type&);
const params&, const forecast_type&, bool);

0 comments on commit 6740996

Please sign in to comment.