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

Bugfix in calculation

parent 1140a190
No related branches found
No related tags found
1 merge request!1Bugfix in calculation
...@@ -285,6 +285,7 @@ public class BremiaLactucaeModel extends I18nImpl implements Model { ...@@ -285,6 +285,7 @@ public class BremiaLactucaeModel extends I18nImpl implements Model {
{ {
this.dataMatrix.setParamDoubleValueForDate(o.getTimeMeasured(), o.getElementMeasurementTypeId(), o.getValue()); this.dataMatrix.setParamDoubleValueForDate(o.getTimeMeasured(), o.getElementMeasurementTypeId(), o.getValue());
} }
//System.out.println(this.dataMatrix.toCSV());
} }
/** /**
...@@ -336,9 +337,10 @@ public class BremiaLactucaeModel extends I18nImpl implements Model { ...@@ -336,9 +337,10 @@ public class BremiaLactucaeModel extends I18nImpl implements Model {
throw new ModelExcecutionException("Not able to determine sunrise today (" + currentDate + "). Too early?"); throw new ModelExcecutionException("Not able to determine sunrise today (" + currentDate + "). Too early?");
} }
Date endOfDataToday = (thisDayInYear < lastDayWithWeatherData) ? justBeforeMidnight Date endOfDataToday = (thisDayInYear < lastDayWithWeatherData) ? justBeforeMidnight
: getDateWithCurrentTime(currentDate); : getDateWithCurrentTime(currentDate).before(lastTimeWithWeatherData) ? getDateWithCurrentTime(currentDate)
: lastTimeWithWeatherData;
//System.out.println(currentDate + ": sunsetYesterday=" + sunsetYesterday + ", sunriseToday=" + sunriseToday ); //System.out.println(currentDate + ": sunsetYesterday=" + sunsetYesterday + ", sunriseToday=" + sunriseToday + ", endOfDataToday=" + endOfDataToday );
// Rule #1 & #2 (Sporulation the night before yesterday?) // Rule #1 & #2 (Sporulation the night before yesterday?)
Boolean enoughRelativeHumidityYesterdayNight = isEnoughRelativeHumidityInPeriod( Boolean enoughRelativeHumidityYesterdayNight = isEnoughRelativeHumidityInPeriod(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment