Skip to content
Snippets Groups Projects
Commit 34ac3f78 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Filling holes of DC with previous value(s)

parent 1092e165
No related branches found
No related tags found
No related merge requests found
Pipeline #314 canceled
target/
classes/
.project
.classpath
.settings/
......@@ -91,7 +91,9 @@ public class MaizePhenologyModel extends I18nImpl implements Model{
Result result = new ResultImpl();
result.setValidTimeStart(currentDate);
Double TMD = this.dataMatrix.getParamDoubleValueForDate(currentDate, DataMatrix.TMD);
Double dailyContribution = this.getDailyContribution(TMD);
Double dailyContribution = TMD != null ? this.getDailyContribution(TMD) // Default: All is well
: retVal.size() > 0 ? Double.valueOf(retVal.get(retVal.size()-1).getValue(MaizePhenologyModel.MODEL_ID.toString(), DataMatrix.DAILY_HEAT_SUM_CONTRIBUTION)) // Simple copy from yesterday
: 0.0; // Panic
heatSum += dailyContribution != null ? dailyContribution : 0.0;
result.setValue(CommonNamespaces.NS_WEATHER, DataMatrix.TMD, TMD != null ? dFormat.format(TMD) : "null");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment