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

New fallback for missing leaf wetness

parent 97ef399e
Branches
Tags
No related merge requests found
......@@ -91,7 +91,9 @@ public class AppleScabModel extends I18nImpl implements Model{
private List<WeatherObservation> RR; // Rainfall
private List<WeatherObservation> BT; // Leaf wetness
// Helper for calculating if missing BT
// Helpers for calculation if missing BT
private List<WeatherObservation> Q0; // Global radiation
private List<WeatherObservation> FM2; // Wind speed 2m above ground (m/s)
private List<WeatherObservation> UM; // Relative humidity
// Helper class
......@@ -302,7 +304,6 @@ public class AppleScabModel extends I18nImpl implements Model{
{
case WeatherElements.TEMPERATURE_MEAN:
this.TM.add(o);
break;
case WeatherElements.PRECIPITATION:
this.RR.add(o);
......@@ -313,6 +314,12 @@ public class AppleScabModel extends I18nImpl implements Model{
case WeatherElements.RELATIVE_HUMIDITY:
this.UM.add(o);
break;
case WeatherElements.GLOBAL_RADIATION:
this.Q0.add(o);
break;
case WeatherElements.WIND_SPEED_2M:
this.FM2.add(o);
break;
default:
// Let it pass in silence
break;
......@@ -340,7 +347,8 @@ public class AppleScabModel extends I18nImpl implements Model{
Collections.sort(this.TM);
Collections.sort(this.RR);
Collections.sort(this.UM);
this.BT = wUtil.calculateLeafWetnessHourSeriesSimple(this.TM, this.RR, this.UM);
Collections.sort(this.Q0);
this.BT = wUtil.calculateLeafWetnessHourSeriesBestEffort(this.BT,this.TM, this.RR, this.Q0, this.FM2, this.UM);
if(this.BT.size() != this.TM.size())
{
......@@ -576,6 +584,8 @@ public class AppleScabModel extends I18nImpl implements Model{
this.RR = new ArrayList();
this.TM = new ArrayList();
this.UM = new ArrayList();
this.Q0 = new ArrayList();
this.FM2 = new ArrayList();
}
/**
......
......@@ -88,7 +88,7 @@ public class AppleScabModelTest extends TestCase {
System.out.println("Model execution took " + (new Date().getTime() - start.getTime()) + " milliseconds");
// Toggle this to print results when testing
//if(results != null)
if(true)
if(false)
{
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
Collections.sort(results);
......@@ -160,7 +160,7 @@ public class AppleScabModelTest extends TestCase {
System.out.println("Model execution took " + (new Date().getTime() - start.getTime()) + " milliseconds");
// Toggle this to print results when testing
//if(results != null)
if(true)
if(false)
{
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
Collections.sort(results);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment