Skip to content
Snippets Groups Projects
Commit 903099d0 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

Warning status

Calculate warning status
parent 3b0b7ba5
No related branches found
No related tags found
No related merge requests found
......@@ -63,9 +63,12 @@ import no.nibio.vips.util.WeatherUtil;
*/
public class AlternariaModel extends I18nImpl implements Model{
public final static String NAME_MODEL_ID = "ALTERNARIA";
public final static ModelId MODEL_ID = new ModelId(NAME_MODEL_ID);
public final static int THRESHOLD = 30;
public final static String NAME_MODEL_ID = "ALTERNARIA";
public final static ModelId MODEL_ID = new ModelId(NAME_MODEL_ID);
public final static int THRESHOLD_LW = 30; // Threshold for leave wetness
public final static int THRESHOLD_DSV_MIN = 20; // Threshold Minimum for DSV
public final static int THRESHOLD_DSV_MAX = 30; // Threshold Maximum for DSV
public final static int THRESHOLD_DSV_BASE = 5; // Threshold Maximum for DSV
......@@ -606,5 +609,51 @@ public class AlternariaModel extends I18nImpl implements Model{
: dataMatrix.getParamIntValueForDate(lwDate, lwFlag);
}
private Integer getWarningStatus(Integer accumulatedDSV)
{
Integer result = 0;
/*
Hint of warning system
1 = Missing data (Blue) - OK
2 = No Risk (Green) – From 0 to DSV-threshold minus 5
3 = Possible Risk (Yellow) – From DSV-threshold minus 5 to DSV-threshold
4 = High Risk (Red) – {Above DSV-threshold
*/
if (accumulatedDSV >= 0)
{
if(accumulatedDSV >= THRESHOLD_DSV_MAX)
{
result = Result.WARNING_STATUS_HIGH_RISK;
}
else
{
// 20 -- 25
if((accumulatedDSV < THRESHOLD_DSV_MAX) && (accumulatedDSV >= (THRESHOLD_DSV_MIN - THRESHOLD_DSV_BASE)) )
{
result = Result.WARNING_STATUS_MINOR_RISK;
}
else
{
if(accumulatedDSV < (THRESHOLD_DSV_MIN - THRESHOLD_DSV_BASE))
{
result = Result.WARNING_STATUS_NO_RISK;
}
}
}
}
else
{
result = Result.WARNING_STATUS_NO_WARNING_MISSING_DATA;
}
return result;
}
}
......@@ -44,7 +44,9 @@ import no.nibio.vips.util.DateMap;
* @author bhabesh
*/
public class DataMatrix extends DateMap{
public final static String WET_HOUR = "WH"; // Leaf wetness 2 m, minutes per hour
public final static String LEAF_WETNESS_DURATION = "BT"; // Leaf wetness 2 m, minutes per hour
public final static String TEMPERATURE_MEAN = "TM"; // Mean Temperature
public final static String DAILY_DISEASE_SEVERITY_VALUE = "DSV"; // Daily Disease Severity Value
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment