diff --git a/.gitignore b/.gitignore
index 58d1ff711ebaffd936893ee6d84417f4982643eb..63f5bc2a4545ccec7c15730f24b3677be28e19fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 target/
-.idea
\ No newline at end of file
+.idea
+.vscode
\ No newline at end of file
diff --git a/README.md b/README.md
index 6584b0ca801f0382890ffdedc96d2f7e8858df7d..c72c7390f5bc06795859ff7691e26db29ab535e5 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,38 @@
-# AlternariaModel
+# AlternariaModel (TOMCAST)
 
-<p><img src="src/main/resources/images/ef-20200421-altenaria.jpg" description="Photo: Bilde: S. Abrahamsen, NLR"/></p>
-<p>TOMCAST is based on a model that was originally developed for leaf spot diseases in tomato. The model that is used here is tested and adapted to be used against early blight in potato in Denmark (Alternaria solani). The model calculates daily risk values (DSV: Disease Severity Values) based on temperature and leaf wetness the previous day. DSV represents the risk of attack of early blight the previous 24 hours. Daily values of DSV are accumulated until a threshold value is reached, and treatment is recommended. When a spray is performed and entered into the model, accumulation of DSV is reset and starts over at 0.</p>
-<p>The model will be evaluated in potato and carrots in Norway in 2020, and is only available for private warnings. Based on experience from other countries, the threshold for a warning to be issued is set to 20.</p>
-<h3>When to initiate the model</h3>
-<p>Potato plants vary in susceptibility during the season, and gradually become more susceptible. This means that the requirement for protection against early blight vary accordingly. The model is started when the first symptoms are visible, and first treatment is performed (below 0,1% attack).</p>
-<h3>Interpretation of results</h3>
-<p>The model will be green (no risk) until it reaches 15. From this value the warning will be yellow (possible risk) until the threshold is reached, and the warning turns red (risk of infection).</p>
+<img src="src/main/resources/images/ef-20200421-altenaria.jpg" description="Photo: S. Abrahamsen, NLR"/>
 
-### Development
+_Photo: S. Abrahamsen, NLR_
+
+TOMCAST is based on a model that was originally developed for leaf spot diseases in tomato. The model that is used here is tested and adapted to be used against early blight in potato in Denmark (Alternaria solani). The model calculates daily risk values (DSV: Disease Severity Values) based on temperature and leaf wetness the previous day. DSV represents the risk of attack of early blight the previous 24 hours. Daily values of DSV are accumulated until a threshold value is reached, and treatment is recommended. When a spray is performed and entered into the model, accumulation of DSV is reset and starts over at 0.
+
+
+## Configurable parameters
+### Lower temperature threshold for DSV
+Default value: 13.0 (as in the original TOMCAST model)
+
+### DSV (Daily Severity Value) Threshold for high infection risk
+Default value: 20
+
+## When to initiate the model
+Potato plants vary in susceptibility during the season, and gradually become more susceptible. This means that the requirement for protection against early blight vary accordingly. The model is started when the first symptoms are visible, and first treatment is performed (below 0,1% attack).
+
+## Interpretation of results
+The model will be green (no risk) until it reaches 15. From this value the warning will be yellow (possible risk) until the threshold is reached, and the warning turns red (risk of infection).
+
+## Development
+Requirements:
+* Maven
+* Java 11
 
 Clone Gitlab repository
 
 ```
 $ git clone https://gitlab.nibio.no/VIPS/models/java/Model_ALTERNARIA.git
 $ cd Model_ALTERNARIA
+```
+
+Build
+```
+$ mvn install
 ```
\ No newline at end of file
diff --git a/src/main/java/no/nibio/vips/model/alternariamodel/AlternariaModel.java b/src/main/java/no/nibio/vips/model/alternariamodel/AlternariaModel.java
index 3363fcbbf4c78da3db3038da0018fb5c95ec59a5..27eda260ebe71127398e68c2571b8b901d0ec71c 100644
--- a/src/main/java/no/nibio/vips/model/alternariamodel/AlternariaModel.java
+++ b/src/main/java/no/nibio/vips/model/alternariamodel/AlternariaModel.java
@@ -39,13 +39,17 @@ package no.nibio.vips.model.alternariamodel;
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.BufferedInputStream;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
+import java.util.Scanner;
 import java.util.TimeZone;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -62,133 +66,139 @@ import no.nibio.vips.util.CommonNamespaces;
 import no.nibio.vips.util.ModelUtil;
 import no.nibio.vips.util.WeatherUtil;
 
-
 /**
  *
  * @author bhabesh
  */
-public class AlternariaModel extends I18nImpl implements Model{
-    public final static Logger      LOGGER              =   Logger.getLogger(AlternariaModel.class.getName());
-    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_MAX   =   20;                         // Threshold Minimum for DSV 
-    public final static int         THRESHOLD_DSV_DIFF_MIN_MAX  =   5;                         // Threshold Maximum for DSV 
-    
-    public final static String      YES                 =   "Y";                        //   Spray Date
-    public final static String      NO                  =   "N"; 
-    
-  
-    private   final   ModelUtil   modelUtil;
-    private           DataMatrix  dataMatrix;
-  
-    private           TimeZone    timeZone;
-  
-    public AlternariaModel()
-    {
+public class AlternariaModel extends I18nImpl implements Model {
+    public final static Logger LOGGER = Logger.getLogger(AlternariaModel.class.getName());
+    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
+    private Double THRESHOLD_DSV_MAX = 20.0; // Threshold Minimum for DSV
+    public final static int THRESHOLD_DSV_DIFF_MIN_MAX = 5; // Threshold Maximum for DSV
+    private Double THRESHOLD_DSV_TEMP_MIN = 13.0; // Minimum temp for getting a DSV value
+    public final static String YES = "Y"; // Spray Date
+    public final static String NO = "N";
+
+    private final ModelUtil modelUtil;
+    private DataMatrix dataMatrix;
+
+    private TimeZone timeZone;
+
+    public AlternariaModel() {
         super("no.nibio.vips.model.alternariamodel.texts");
-        this.modelUtil    = new ModelUtil();
+        this.modelUtil = new ModelUtil();
     }
-          
+
     @Override
-    public List<Result> getResult() throws ModelExcecutionException
-    {
-        
+    public List<Result> getResult() throws ModelExcecutionException {
+
         /**
          * method name : getResult
-         * @param      :
-         * @return     : java.util.List<no.nibio.vips.entity.Result>
+         * 
+         * @param :
+         * @return : java.util.List<no.nibio.vips.entity.Result>
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
-        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-                //TODO write proper list of result object
-        
-        //Date            currentDate     =   this.dataMatrix.getFirstDateWithParameterValue(DataMatrix.LEAF_WETNESS_DURATION);
-        List<Result>    results         =   new ArrayList<>();
-        
-        Date            currentDate     =   this.dataMatrix.getFirstDateWithParameterValue(DataMatrix.TEMPERATURE_MEAN);
-        Date            endDate         =   this.dataMatrix.getLastDateWithParameterValue(DataMatrix.TEMPERATURE_MEAN);
-        DecimalFormat   dFormat         =   new DecimalFormat("###.##");
-        DecimalFormat   iFormat         =   new DecimalFormat("###");
-        Calendar        cal             =   Calendar.getInstance(timeZone);
-        int             accumulatedDSV  =   0;
-        
-        while(currentDate.before(endDate))
-        {
-            Result              result              = new ResultImpl();
-            
-                                if(null == dataMatrix.getParamStringValueForDate(currentDate, DataMatrix.SPRAYING_DATE))
-                                {
-                                    // DO Nothing -- Consider same accumulatedDSV
-                                }
-                                else
-                                {
-                                    if(dataMatrix.getParamStringValueForDate(currentDate, DataMatrix.SPRAYING_DATE).equals(YES))
-                                    {
-                                        accumulatedDSV  = 0;
-                                    }
-                                    else
-                                
-                                    {
-                                        accumulatedDSV      =   accumulatedDSV  +   dataMatrix.getParamIntValueForDate(currentDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE);
-                                    }
-                                }
-                                    
-                                
-                    result.setValidTimeStart(currentDate);
-                    result.setWarningStatus(getWarningStatus(accumulatedDSV));
-
-                    result.setValue(CommonNamespaces.NS_WEATHER, DataMatrix.TEMPERATURE_MEAN, dFormat.format(this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.TEMPERATURE_MEAN)));
-                    result.setValue(NAME_MODEL_ID, DataMatrix.WET_HOUR, iFormat.format(this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.LEAF_WETNESS_DURATION)));
-                    result.setValue(NAME_MODEL_ID, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE_SUM, iFormat.format(accumulatedDSV));
-                    result.setValue(NAME_MODEL_ID, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, iFormat.format(this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE)));
-
-                    result.setValue(NAME_MODEL_ID, DataMatrix.THRESHOLD_DSV_BASE, String.valueOf(THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX));
-                    result.setValue(NAME_MODEL_ID, DataMatrix.THRESHOLD_DSV_MAX, String.valueOf(THRESHOLD_DSV_MAX));
-                    
-                    results.add(result);
-                    
+        // throw new UnsupportedOperationException("Not supported yet."); //To change
+        // body of generated methods, choose Tools | Templates.
+        // TODO write proper list of result object
+
+        // Date currentDate =
+        // this.dataMatrix.getFirstDateWithParameterValue(DataMatrix.LEAF_WETNESS_DURATION);
+        List<Result> results = new ArrayList<>();
+
+        Date currentDate = this.dataMatrix.getFirstDateWithParameterValue(DataMatrix.TEMPERATURE_MEAN);
+        Date endDate = this.dataMatrix.getLastDateWithParameterValue(DataMatrix.TEMPERATURE_MEAN);
+        DecimalFormat dFormat = new DecimalFormat("###.##");
+        DecimalFormat iFormat = new DecimalFormat("###");
+        Calendar cal = Calendar.getInstance(timeZone);
+        int accumulatedDSV = 0;
+
+        while (currentDate.before(endDate)) {
+            Result result = new ResultImpl();
+
+            if (null == dataMatrix.getParamStringValueForDate(currentDate, DataMatrix.SPRAYING_DATE)) {
+                // DO Nothing -- Consider same accumulatedDSV
+            } else {
+                if (dataMatrix.getParamStringValueForDate(currentDate, DataMatrix.SPRAYING_DATE).equals(YES)) {
+                    accumulatedDSV = 0;
+                } else
+
+                {
+                    accumulatedDSV = accumulatedDSV
+                            + dataMatrix.getParamIntValueForDate(currentDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE);
+                }
+            }
+
+            result.setValidTimeStart(currentDate);
+            result.setWarningStatus(getWarningStatus(accumulatedDSV));
+
+            result.setValue(CommonNamespaces.NS_WEATHER, DataMatrix.TEMPERATURE_MEAN,
+                    dFormat.format(this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.TEMPERATURE_MEAN)));
+            result.setValue(NAME_MODEL_ID, DataMatrix.WET_HOUR, iFormat
+                    .format(this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.LEAF_WETNESS_DURATION)));
+            result.setValue(NAME_MODEL_ID, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE_SUM, iFormat.format(accumulatedDSV));
+            result.setValue(NAME_MODEL_ID, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, iFormat.format(
+                    this.dataMatrix.getParamValueForDate(currentDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE)));
+
+            result.setValue(NAME_MODEL_ID, DataMatrix.THRESHOLD_DSV_BASE,
+                    String.valueOf(THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX));
+            result.setValue(NAME_MODEL_ID, DataMatrix.THRESHOLD_DSV_MAX, String.valueOf(THRESHOLD_DSV_MAX));
+            result.setValue(NAME_MODEL_ID, DataMatrix.THRESHOLD_DSV_TEMP_MIN, String.valueOf(this.THRESHOLD_DSV_TEMP_MIN));
+
+            results.add(result);
+
             cal.setTime(currentDate);
             cal.add(Calendar.DATE, 1);
-            currentDate = cal.getTime();               
+            currentDate = cal.getTime();
         }
 
-        //LOGGER.log(Level.INFO, "DataMatrix-Value 03: "+dataMatrix);
+        // LOGGER.log(Level.INFO, "DataMatrix-Value 03: "+dataMatrix);
         return results;
     }
 
-
     @Override
-    public ModelId getModelId()
-    {
+    public ModelId getModelId() {
         /**
          * method name : getModelId
-         * @param      : 
-         * @return     : no.nibio.vips.model.ModelId
+         * 
+         * @param :
+         * @return : no.nibio.vips.model.ModelId
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
-        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+        // throw new UnsupportedOperationException("Not supported yet."); //To change
+        // body of generated methods, choose Tools | Templates.
         return AlternariaModel.MODEL_ID;
     }
 
-
     @Override
-    public String getModelName()
-    {
+    public String getModelName() {
         /**
          * method name : getModelName
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getModelName(Model.DEFAULT_LANGUAGE);
     }
@@ -196,64 +206,64 @@ public class AlternariaModel extends I18nImpl implements Model{
     /**
      * 
      * @param language
-     * @return 
+     * @return
      */
     @Override
-    public String getModelName(String language)
-    {
+    public String getModelName(String language) {
         /**
          * method name : getModelName
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getText("name", language);
     }
 
+
     @Override
-    public String getLicense()
-    {
-        /**
-         * method name : getLicense
-         * @param      :
-         * @return     : java.lang.String
-         *
-         * purpose     :
-         *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
-         */
-        return this.getText("license", Model.DEFAULT_LANGUAGE);
+    public String getLicense() {
+        return this.modelUtil.getTextFromFileInJar(this.getClass(), "/LICENSE_header.txt");
     }
 
     @Override
-    public String getCopyright()
-    {
+    public String getCopyright() {
         /**
          * method name : getCopyright
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return "(c) 2020 NIBIO (http://www.nibio.no/). Contact: post@nibio.no";
     }
 
     @Override
-    public String getModelDescription()
-    {
+    public String getModelDescription() {
         /**
          * method name : getModelDescription
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getModelDescription(Model.DEFAULT_LANGUAGE);
     }
@@ -261,507 +271,456 @@ public class AlternariaModel extends I18nImpl implements Model{
     /**
      * 
      * @param language
-     * @return 
+     * @return
      */
     @Override
-    public String getModelDescription(String language)
-    {
+    public String getModelDescription(String language) {
         /**
          * method name : getModelDescription
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
-        try
-        {
-            return this.modelUtil.getTextWithBase64EncodedImages(this.getText("description", language), this.getClass());
-        }
-        catch (IOException ex)
-        {
+        try {
+            return this.modelUtil.getTextWithBase64EncodedImages(this.getText("description", language),
+                    this.getClass());
+        } catch (IOException ex) {
             return this.getText("description", language);
         }
     }
 
     @Override
-    public String getWarningStatusInterpretation()
-    {
+    public String getWarningStatusInterpretation() {
         /**
          * method name : getWarningStatusInterpretation
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getWarningStatusInterpretation(Model.DEFAULT_LANGUAGE);
     }
 
     @Override
-    public String getWarningStatusInterpretation(String language)
-    {
+    public String getWarningStatusInterpretation(String language) {
         /**
          * method name : getWarningStatusInterpretation
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getText("statusInterpretation", language);
     }
 
     @Override
-    public String getModelUsage()
-    {
+    public String getModelUsage() {
         /**
          * method name : getModelUsage
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getModelUsage(Model.DEFAULT_LANGUAGE);
     }
 
     @Override
-    public String getModelUsage(String language)
-    {
+    public String getModelUsage(String language) {
         /**
          * method name : getModelUsage
-         * @param      :
-         * @return     : java.lang.String
+         * 
+         * @param :
+         * @return : java.lang.String
          *
-         * purpose     :
+         *         purpose :
          *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
+         *         date : Expression date is undefined on line 20, column 19 in
+         *         Templates/Classes/Code/GeneratedMethodBody. Expression time is
+         *         undefined on line 20, column 27 in
+         *         Templates/Classes/Code/GeneratedMethodBody.
          */
         return this.getText("usage", language);
     }
 
     /**
-     * TODO
-     * @return 
+     * 
+     * 
+     * @return a Json configuration example
      */
     @Override
-    public String getSampleConfig()
-    {
-        /**
-         * method name : getSampleConfig
-         * @param      :
-         * @return     : java.lang.String
-         *
-         * purpose     :
-         *
-         * date        : Expression date is undefined on line 20, column 19 in Templates/Classes/Code/GeneratedMethodBody. Expression time is undefined on line 20, column 27 in Templates/Classes/Code/GeneratedMethodBody.
-         */
-        return this.getText("sampleconfig", Model.DEFAULT_LANGUAGE);
+    public String getSampleConfig() {
+        return this.modelUtil.getTextFromFileInJar(this.getClass(), "/sample_config.json");
     }
 
     /**
      * 
      * @param config
-     * @throws ConfigValidationException 
+     * @throws ConfigValidationException
      */
     @Override
-    public void setConfiguration(ModelConfiguration config) throws ConfigValidationException
-    {
-
-        
-        List<WeatherObservation>    altenariaWeatherListDaily                       =   new ArrayList<WeatherObservation>();
-        
-                                    dataMatrix                                      =   new DataMatrix();
-        ObjectMapper                mapper                                          =   new ObjectMapper();
-                                    timeZone                                        =   TimeZone.getTimeZone((String)config.getConfigParameter("timeZone"));
-                                    
-
-        WeatherUtil                 weatherUtil                                     =   new WeatherUtil();
-        List<WeatherObservation>    observations                                    =   modelUtil.extractWeatherObservationList(config.getConfigParameter("observations"));
-        List<Date>                  sprayingDates                                   =   null;
-        List<WeatherObservation>    altenariaWeatherLIstHourly_tm                   =   new ArrayList<WeatherObservation>();
-        List<WeatherObservation>    altenariaWeatherLIstHourly_lw                   =   new ArrayList<WeatherObservation>();
-           
-        Date                        dateHourlyTm_currentDay                         =   null; 
-        Date                        dateHourlyTm_previousDay                        =   null; 
-        Date                        dateHourlyLw_currentDay                         =   null; 
-        Date                        dateHourlyLw_previousDay                        =   null; 
-        
+    public void setConfiguration(ModelConfiguration config) throws ConfigValidationException {
+
+        List<WeatherObservation> altenariaWeatherListDaily = new ArrayList<WeatherObservation>();
+
+        dataMatrix = new DataMatrix();
+        ObjectMapper mapper = new ObjectMapper();
+        timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
+
+        WeatherUtil weatherUtil = new WeatherUtil();
+        List<WeatherObservation> observations = modelUtil
+                .extractWeatherObservationList(config.getConfigParameter("observations"));
+        List<Date> sprayingDates = null;
+        List<WeatherObservation> altenariaWeatherLIstHourly_tm = new ArrayList<WeatherObservation>();
+        List<WeatherObservation> altenariaWeatherLIstHourly_lw = new ArrayList<WeatherObservation>();
+
+        try
+        {
+            this.THRESHOLD_DSV_TEMP_MIN = config.getConfigParameter(DataMatrix.THRESHOLD_DSV_TEMP_MIN) != null ? modelUtil.getDouble(config.getConfigParameter(DataMatrix.THRESHOLD_DSV_TEMP_MIN)): this.THRESHOLD_DSV_TEMP_MIN;
+            this.THRESHOLD_DSV_MAX = config.getConfigParameter(DataMatrix.THRESHOLD_DSV_MAX) != null ? modelUtil.getDouble(config.getConfigParameter(DataMatrix.THRESHOLD_DSV_MAX)) : this.THRESHOLD_DSV_MAX;
+        }
+        catch(ClassCastException ex)
+        {
+            throw new ConfigValidationException(ex.getMessage());
+        }
+
+        Date dateHourlyTm_currentDay = null;
+        Date dateHourlyTm_previousDay = null;
+        Date dateHourlyLw_currentDay = null;
+        Date dateHourlyLw_previousDay = null;
+
         WeatherUtil wUtil = new WeatherUtil();
-                // Setting timezone
+        // Setting timezone
         this.timeZone = TimeZone.getTimeZone((String) config.getConfigParameter("timeZone"));
 
-                                    sprayingDates                                   =   (null == mapper.convertValue(config.getConfigParameter(DataMatrix.SPRAYING_DATES), new TypeReference<List<Date>>(){})) 
-                                                                                        ?   null
-                                                                                        :   mapper.convertValue(config.getConfigParameter(DataMatrix.SPRAYING_DATES), new TypeReference<List<Date>>(){});
-                            
+        sprayingDates = (null == mapper.convertValue(config.getConfigParameter(DataMatrix.SPRAYING_DATES),
+                new TypeReference<List<Date>>() {
+                }))
+                        ? null
+                        : mapper.convertValue(config.getConfigParameter(DataMatrix.SPRAYING_DATES),
+                                new TypeReference<List<Date>>() {
+                                });
 
-        
-        int         count = 0;
+        int count = 0;
         Collections.sort(observations);
-        for(WeatherObservation weatherObj: observations)
-        {
-                
-                weatherObj.setTimeMeasured(wUtil.pragmaticAdjustmentToMidnight(weatherObj.getTimeMeasured(), timeZone));
-                
-                Date    sprayDate   =   null;
-                
-                switch(weatherObj.getElementMeasurementTypeId())
-                {
-                
-                    case    DataMatrix.TEMPERATURE_MEAN:
-                        dateHourlyTm_currentDay                                     =   trimmedDate(weatherObj.getTimeMeasured(),timeZone);
-                        if(weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1H))
-                        {
-                            WeatherObservation      altanariaWeatherBO_tm_hourly    =   weatherObj;
-                            if  (
-                                        (null != dateHourlyTm_currentDay )
-                                    &&  (null != dateHourlyTm_previousDay)
-                                    &&  dateHourlyTm_currentDay.after   (
-                                                                            dateHourlyTm_previousDay
-                                                                        )
-                                )
-                            {
-                                double counterTMHourly     =    0;
-                                
-                                //TODO calculation of accumulation value and add to daily
-                                for(WeatherObservation wo: altenariaWeatherLIstHourly_tm)
-                                {
-                                    counterTMHourly                 =       counterTMHourly + wo.getValue();
+        for (WeatherObservation weatherObj : observations) {
 
-                                }
-                                //average value of temperature for a day
-                                dataMatrix.setParamDoubleValueForDate   (       dateHourlyTm_previousDay
-                                                                            ,   DataMatrix.TEMPERATURE_MEAN
-                                                                            ,   (
-                                                                                    counterTMHourly
-                                                                                    /
-                                                                                    altenariaWeatherLIstHourly_tm.size()
-                                                                                )
-                                                                        );
-
-                                    //discard old value for next day and start fresh
-                                    altenariaWeatherLIstHourly_tm  =        new ArrayList<WeatherObservation>();
-                            }
+            weatherObj.setTimeMeasured(wUtil.pragmaticAdjustmentToMidnight(weatherObj.getTimeMeasured(), timeZone));
 
-                                    altenariaWeatherLIstHourly_tm.add(altanariaWeatherBO_tm_hourly);
-                        }
+            Date sprayDate = null;
+
+            switch (weatherObj.getElementMeasurementTypeId()) {
+
+                case DataMatrix.TEMPERATURE_MEAN:
+                    dateHourlyTm_currentDay = trimmedDate(weatherObj.getTimeMeasured(), timeZone);
+                    if (weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1H)) {
+                        WeatherObservation altanariaWeatherBO_tm_hourly = weatherObj;
+                        if ((null != dateHourlyTm_currentDay)
+                                && (null != dateHourlyTm_previousDay)
+                                && dateHourlyTm_currentDay.after(
+                                        dateHourlyTm_previousDay)) {
+                            double counterTMHourly = 0;
+
+                            // TODO calculation of accumulation value and add to daily
+                            for (WeatherObservation wo : altenariaWeatherLIstHourly_tm) {
+                                counterTMHourly = counterTMHourly + wo.getValue();
 
-                        if(weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1D))
-                        {
-                                    if  (
-                                                (null == dataMatrix.getParamDoubleValueForDate(dateHourlyTm_currentDay, DataMatrix.TEMPERATURE_MEAN) )
-                                            || 
-                                                ((dataMatrix.getParamDoubleValueForDate(dateHourlyTm_currentDay, DataMatrix.TEMPERATURE_MEAN)).intValue() == 0)
-                                        )
-                            {
-                                dataMatrix.setParamDoubleValueForDate   (
-                                                                                weatherObj.getTimeMeasured()  //TODO - Might be the date need to be trimmed
-                                                                            ,   DataMatrix.TEMPERATURE_MEAN
-                                                                            ,   weatherObj.getValue()
-                                                                        );
                             }
+                            // average value of temperature for a day
+                            dataMatrix.setParamDoubleValueForDate(dateHourlyTm_previousDay, DataMatrix.TEMPERATURE_MEAN,
+                                    (counterTMHourly
+                                            /
+                                            altenariaWeatherLIstHourly_tm.size()));
+
+                            // discard old value for next day and start fresh
+                            altenariaWeatherLIstHourly_tm = new ArrayList<WeatherObservation>();
                         }
-                        
-                        
-                        break; 
-                    
-                    
-                    
-                    case    DataMatrix.LEAF_WETNESS_DURATION:
-                        dateHourlyLw_currentDay                                     =   trimmedDate(weatherObj.getTimeMeasured(),timeZone);
-                        if(weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1H))
-                        {
-                            WeatherObservation      altanariaWeatherBO_lw_hourly    =   weatherObj;
-                            if(
-                                        null != dateHourlyLw_currentDay
-                                    &&  null != dateHourlyLw_previousDay 
-                                    &&  dateHourlyLw_currentDay.after(dateHourlyLw_previousDay)
-                                )
-                            {
-                                int counterLwHourly     = 0;
-                                for(WeatherObservation wo: altenariaWeatherLIstHourly_lw)
-                                {
-                                    if(wo.getValue()    >= THRESHOLD_LW )
-                                    {
-                                        counterLwHourly = counterLwHourly + 1;
-                                    }
-                                }
 
-                                dataMatrix.setParamIntValueForDate(
-                                                                        dateHourlyLw_previousDay
-                                                                    ,   DataMatrix.LEAF_WETNESS_DURATION
-                                                                    ,   counterLwHourly
-                                                                   );
-                                
-                                altenariaWeatherLIstHourly_lw   =   new ArrayList<WeatherObservation>();
+                        altenariaWeatherLIstHourly_tm.add(altanariaWeatherBO_tm_hourly);
+                    }
+
+                    if (weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1D)) {
+                        if ((null == dataMatrix.getParamDoubleValueForDate(dateHourlyTm_currentDay,
+                                DataMatrix.TEMPERATURE_MEAN))
+                                ||
+                                ((dataMatrix.getParamDoubleValueForDate(dateHourlyTm_currentDay,
+                                        DataMatrix.TEMPERATURE_MEAN)).intValue() == 0)) {
+                            dataMatrix.setParamDoubleValueForDate(
+                                    weatherObj.getTimeMeasured() // TODO - Might be the date need to be trimmed
+                                    , DataMatrix.TEMPERATURE_MEAN, weatherObj.getValue());
+                        }
+                    }
+
+                    break;
+
+                case DataMatrix.LEAF_WETNESS_DURATION:
+                    dateHourlyLw_currentDay = trimmedDate(weatherObj.getTimeMeasured(), timeZone);
+                    if (weatherObj.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1H)) {
+                        WeatherObservation altanariaWeatherBO_lw_hourly = weatherObj;
+                        if (null != dateHourlyLw_currentDay
+                                && null != dateHourlyLw_previousDay
+                                && dateHourlyLw_currentDay.after(dateHourlyLw_previousDay)) {
+                            int counterLwHourly = 0;
+                            for (WeatherObservation wo : altenariaWeatherLIstHourly_lw) {
+                                if (wo.getValue() >= THRESHOLD_LW) {
+                                    counterLwHourly = counterLwHourly + 1;
+                                }
                             }
 
-                                altenariaWeatherLIstHourly_lw.add(altanariaWeatherBO_lw_hourly);
+                            dataMatrix.setParamIntValueForDate(
+                                    dateHourlyLw_previousDay, DataMatrix.LEAF_WETNESS_DURATION, counterLwHourly);
+
+                            altenariaWeatherLIstHourly_lw = new ArrayList<WeatherObservation>();
                         }
-                                
-                        break;
-                                
-                    
-                }
 
-        if(null != sprayingDates && sprayingDates.size() != 0) 
-        {
-            for (Date spDate:sprayingDates)
-            {
-                spDate  = trimmedDate(spDate, timeZone);
-                if(
-                        (null != spDate && (null != dateHourlyTm_previousDay ) && (null != dateHourlyLw_previousDay))
-                        &&
-                            (
-                                     ( spDate.compareTo(dateHourlyTm_previousDay)== 0 || spDate.before(dateHourlyTm_previousDay) )
-                                ||  ( spDate.compareTo(dateHourlyLw_previousDay)== 0 || spDate.before(dateHourlyLw_previousDay) )
-                            )
-                  )
-                {
-                    sprayDate   = trimmedDate(spDate, timeZone);
-                }
+                        altenariaWeatherLIstHourly_lw.add(altanariaWeatherBO_lw_hourly);
+                    }
+
+                    break;
+
+            }
+
+            if (null != sprayingDates && sprayingDates.size() != 0) {
+                for (Date spDate : sprayingDates) {
+                    spDate = trimmedDate(spDate, timeZone);
+                    if ((null != spDate && (null != dateHourlyTm_previousDay) && (null != dateHourlyLw_previousDay))
+                            &&
+                            ((spDate.compareTo(dateHourlyTm_previousDay) == 0
+                                    || spDate.before(dateHourlyTm_previousDay))
+                                    || (spDate.compareTo(dateHourlyLw_previousDay) == 0
+                                            || spDate.before(dateHourlyLw_previousDay)))) {
+                        sprayDate = trimmedDate(spDate, timeZone);
+                    }
 
+                }
             }
-        }         
-            //Setting DSV values to dataMatrix
-            setDSV(dataMatrix
-                    ,   dateHourlyTm_previousDay
-                    ,   DataMatrix.TEMPERATURE_MEAN
-                    ,   dateHourlyLw_previousDay
-                    ,   DataMatrix.LEAF_WETNESS_DURATION
-                    ,   sprayDate
-                   );
+            // Setting DSV values to dataMatrix
+            setDSV(dataMatrix, dateHourlyTm_previousDay, DataMatrix.TEMPERATURE_MEAN, dateHourlyLw_previousDay,
+                    DataMatrix.LEAF_WETNESS_DURATION, sprayDate);
 
             dateHourlyTm_previousDay = dateHourlyTm_currentDay;
             dateHourlyLw_previousDay = dateHourlyLw_currentDay;
-            
+
         }
-   
-          //LOGGER.log(Level.INFO, dataMatrix.toString());
+
+        // LOGGER.log(Level.INFO, dataMatrix.toString());
     }
 
-  
-    
     /**
-     * method name  : getDSV
+     * method name : getDSV
+     * 
      * @param temp
      * @param lw
-     * @return 
-     * purpose      :   DSV (Daily Severity Value) calculation based on mean temperature
-     *                  and Leaf Wetness
+     * @return
+     *         purpose : DSV (Daily Severity Value) calculation based on mean
+     *         temperature
+     *         and Leaf Wetness
      */
-    public int getDSV_DAILY(double temp, int lw )
-    {
+    public int getDSV_DAILY(double temp, int lw) {
         int dsvResult = 0;
 
-        if ((temp >= 10  && temp <= 17) && (lw <= 6))                   dsvResult  =    0;
-        if ((temp >= 10  && temp <= 17) && (lw >= 7  && lw  <= 15 ))    dsvResult  =    1;
-        if ((temp >= 10  && temp <= 17) && (lw >= 16 && lw  <= 20 ))    dsvResult  =    2;
-        if ((temp >= 10  && temp <= 17) && (lw > 21 ))                  dsvResult  =    3;
-        
-        if ((temp >= 18  && temp <= 20) && (lw <= 3 ))                  dsvResult =     0;
-        if ((temp >= 18  && temp <= 20) && (lw >= 4  && lw <= 8 ))      dsvResult =     1;
-        if ((temp >= 18  && temp <= 20) && (lw >= 9  && lw <= 15))      dsvResult =     2;
-        if ((temp >= 18  && temp <= 20) && (lw >= 16 && lw <= 22))      dsvResult =     3;
-        if ((temp >= 18  && temp <= 20) && (lw >= 23))                  dsvResult =     4;
-        
-        if ((temp >= 21  && temp <= 25) && (lw <= 2 ))                  dsvResult =     0;
-        if ((temp >= 21  && temp <= 25) && (lw >= 3  && lw <= 5 ))      dsvResult =     1;
-        if ((temp >= 21  && temp <= 25) && (lw >= 6  && lw <= 12))      dsvResult =     2;
-        if ((temp >= 21  && temp <= 25) && (lw >= 13 && lw <= 20))      dsvResult =     3;
-        if ((temp >= 21  && temp <= 25) && (lw >= 21))                  dsvResult =     4;
-        
-        if ((temp >= 26  && temp <= 29) && (lw <= 3))                   dsvResult =     0;
-        if ((temp >= 26  && temp <= 29) && (lw >= 4  && lw <= 8))       dsvResult =     1;
-        if ((temp >= 26  && temp <= 29) && (lw >= 9  && lw <= 15))      dsvResult =     2;
-        if ((temp >= 26  && temp <= 29) && (lw >= 16 && lw <= 22))      dsvResult =     3;
-        if ((temp >= 26  && temp <= 29) && (lw >= 23 ))                 dsvResult =     4;
-        
-        
+        if ((temp >= this.THRESHOLD_DSV_TEMP_MIN && temp <= 17) && (lw <= 6))
+            dsvResult = 0;
+        if ((temp >= this.THRESHOLD_DSV_TEMP_MIN && temp <= 17) && (lw >= 7 && lw <= 15))
+            dsvResult = 1;
+        if ((temp >= this.THRESHOLD_DSV_TEMP_MIN && temp <= 17) && (lw >= 16 && lw <= 20))
+            dsvResult = 2;
+        if ((temp >= this.THRESHOLD_DSV_TEMP_MIN && temp <= 17) && (lw > 21))
+            dsvResult = 3;
+
+        if ((temp >= 18 && temp <= 20) && (lw <= 3))
+            dsvResult = 0;
+        if ((temp >= 18 && temp <= 20) && (lw >= 4 && lw <= 8))
+            dsvResult = 1;
+        if ((temp >= 18 && temp <= 20) && (lw >= 9 && lw <= 15))
+            dsvResult = 2;
+        if ((temp >= 18 && temp <= 20) && (lw >= 16 && lw <= 22))
+            dsvResult = 3;
+        if ((temp >= 18 && temp <= 20) && (lw >= 23))
+            dsvResult = 4;
+
+        if ((temp >= 21 && temp <= 25) && (lw <= 2))
+            dsvResult = 0;
+        if ((temp >= 21 && temp <= 25) && (lw >= 3 && lw <= 5))
+            dsvResult = 1;
+        if ((temp >= 21 && temp <= 25) && (lw >= 6 && lw <= 12))
+            dsvResult = 2;
+        if ((temp >= 21 && temp <= 25) && (lw >= 13 && lw <= 20))
+            dsvResult = 3;
+        if ((temp >= 21 && temp <= 25) && (lw >= 21))
+            dsvResult = 4;
+
+        if ((temp >= 26 && temp <= 29) && (lw <= 3))
+            dsvResult = 0;
+        if ((temp >= 26 && temp <= 29) && (lw >= 4 && lw <= 8))
+            dsvResult = 1;
+        if ((temp >= 26 && temp <= 29) && (lw >= 9 && lw <= 15))
+            dsvResult = 2;
+        if ((temp >= 26 && temp <= 29) && (lw >= 16 && lw <= 22))
+            dsvResult = 3;
+        if ((temp >= 26 && temp <= 29) && (lw >= 23))
+            dsvResult = 4;
+
         return dsvResult;
     }
-    
+
     /**
      * Get a trimmed date without hour,minute,second,milli second
+     * 
      * @param date
-     * @return 
+     * @return
      */
-    private Date trimmedDate(Date date, TimeZone timezone)
-    {
-        Date        resultDate  = date; 
-        Calendar     calendar   =  Calendar.getInstance();
+    private Date trimmedDate(Date date, TimeZone timezone) {
+        Date resultDate = date;
+        Calendar calendar = Calendar.getInstance();
         calendar.setTimeZone(timezone);
         calendar.setTime(resultDate);
         calendar.set(Calendar.HOUR_OF_DAY, 0);
-        calendar.set(Calendar.MINUTE,0);
-        calendar.set(Calendar.SECOND,0);
-        calendar.set(Calendar.MILLISECOND,0);
-        
-        return   calendar.getTime();
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+
+        return calendar.getTime();
     }
 
     /**
      * Set DSV values to the DataMatrix in HashMap
+     * 
      * @param dataMatrix
      * @param tmDate
      * @param tmFlag
      * @param lwDate
-     * @param lwFlag 
+     * @param lwFlag
      */
     private void setDSV(
-            DataMatrix dataMatrix, Date tmDate, String tmFlag, Date lwDate, String lwFlag, Date sprayDate)
-    {
-        int     resultDSV_tm           =   0;
-        int     resultDSV_lw           =   0;
-        
-        
-        if((null != tmDate) && (null != lwDate))
-        {
-  
-                    resultDSV_tm    =   getDSV_DAILY(
-                                                            getMeanTeamperature(dataMatrix,tmDate,tmFlag)
-                                                        ,  
-                                                            getLeafWetnessHour(dataMatrix,tmDate,lwFlag)
-                                                    );
-                    
-                                                    
-                    dataMatrix.setParamStringValueForDate(tmDate, DataMatrix.SPRAYING_DATE, NO);
-                    dataMatrix.setParamIntValueForDate(tmDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, resultDSV_tm);
-                    if(null != sprayDate ) 
-                    {
-                      if (tmDate.compareTo(sprayDate)== 0 || sprayDate.before(tmDate))
-                      {
-                          dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, YES);
-                      }
-                      else if(null == sprayDate || sprayDate.after(tmDate))
-                            {
-                                dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, NO);
-                            }
-                      
-                     }
-                    
-                        
-                    
-                    
-                    
-                    resultDSV_lw    =   getDSV_DAILY(
-                                        getMeanTeamperature(dataMatrix,lwDate,tmFlag)
-                                    ,  
-                                        getLeafWetnessHour(dataMatrix,lwDate,lwFlag)
-                                );
-                    
-                    dataMatrix.setParamStringValueForDate(lwDate, DataMatrix.SPRAYING_DATE, NO);
-                    dataMatrix.setParamIntValueForDate(lwDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, resultDSV_lw);
-                    
-
-                        if(null != sprayDate)
-                        {
-                            if ((lwDate.compareTo(sprayDate)== 0) || sprayDate.before(lwDate))
-                            {
-                                dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, YES);
-                            }
-                            else if(null == sprayDate || sprayDate.after(lwDate))
-                            {
-                                dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, NO);
-                            }
-                        }
-                        
-                    
-                    
-                    
-                    
-                    
-                    
+            DataMatrix dataMatrix, Date tmDate, String tmFlag, Date lwDate, String lwFlag, Date sprayDate) {
+        int resultDSV_tm = 0;
+        int resultDSV_lw = 0;
+
+        if ((null != tmDate) && (null != lwDate)) {
+
+            resultDSV_tm = getDSV_DAILY(
+                    getMeanTeamperature(dataMatrix, tmDate, tmFlag),
+                    getLeafWetnessHour(dataMatrix, tmDate, lwFlag));
+
+            dataMatrix.setParamStringValueForDate(tmDate, DataMatrix.SPRAYING_DATE, NO);
+            dataMatrix.setParamIntValueForDate(tmDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, resultDSV_tm);
+            if (null != sprayDate) {
+                if (tmDate.compareTo(sprayDate) == 0 || sprayDate.before(tmDate)) {
+                    dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, YES);
+                } else if (null == sprayDate || sprayDate.after(tmDate)) {
+                    dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, NO);
+                }
+
+            }
+
+            resultDSV_lw = getDSV_DAILY(
+                    getMeanTeamperature(dataMatrix, lwDate, tmFlag),
+                    getLeafWetnessHour(dataMatrix, lwDate, lwFlag));
+
+            dataMatrix.setParamStringValueForDate(lwDate, DataMatrix.SPRAYING_DATE, NO);
+            dataMatrix.setParamIntValueForDate(lwDate, DataMatrix.DAILY_DISEASE_SEVERITY_VALUE, resultDSV_lw);
+
+            if (null != sprayDate) {
+                if ((lwDate.compareTo(sprayDate) == 0) || sprayDate.before(lwDate)) {
+                    dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, YES);
+                } else if (null == sprayDate || sprayDate.after(lwDate)) {
+                    dataMatrix.setParamStringValueForDate(sprayDate, DataMatrix.SPRAYING_DATE, NO);
+                }
+            }
+
         }
-        
+
     }
-    
+
     /**
      * 
      * @param dataMatrix
      * @param tmDate
      * @param tmFlag
-     * @return 
+     * @return
      */
-    private double getMeanTeamperature (    DataMatrix dataMatrix
-                                        ,    Date tmDate
-                                        ,   String tmFlag
-                                        )
-    {
-        return     (null ==  dataMatrix.getParamDoubleValueForDate(tmDate, tmFlag))
-                                            ?   0.0
-                                            :   dataMatrix.getParamDoubleValueForDate(tmDate, tmFlag);
+    private double getMeanTeamperature(DataMatrix dataMatrix, Date tmDate, String tmFlag) {
+        return (null == dataMatrix.getParamDoubleValueForDate(tmDate, tmFlag))
+                ? 0.0
+                : dataMatrix.getParamDoubleValueForDate(tmDate, tmFlag);
     }
-            
+
     /**
      * 
      * @param dataMatrix
      * @param lwDate
      * @param lwFlag
-     * @return 
+     * @return
      */
-    private int     getLeafWetnessHour(
-                                        DataMatrix dataMatrix
-                                    ,   Date lwDate
-                                    ,   String lwFlag
-                                    )
-    {
-            return (null == dataMatrix.getParamIntValueForDate(lwDate, lwFlag))
-                                            ?   0
-                                            :   dataMatrix.getParamIntValueForDate(lwDate, lwFlag);
+    private int getLeafWetnessHour(
+            DataMatrix dataMatrix, Date lwDate, String lwFlag) {
+        return (null == dataMatrix.getParamIntValueForDate(lwDate, lwFlag))
+                ? 0
+                : 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
+    private Integer getWarningStatus(Integer accumulatedDSV) {
+        Integer result = 0;
 
-            3 = Possible Risk (Yellow) – From DSV-threshold minus 5 to DSV-threshold
+        /*
+         * 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
+         */
 
-            4 = High Risk (Red) – {Above DSV-threshold
-        */
-  
-        if (accumulatedDSV >= 0)
-        {
-            if(accumulatedDSV >= THRESHOLD_DSV_MAX)
-            {
+        if (accumulatedDSV >= 0) {
+            if (accumulatedDSV >= THRESHOLD_DSV_MAX) {
                 result = Result.WARNING_STATUS_HIGH_RISK;
-            }
-            else
-            {
+            } else {
                 // e.g. 20 -- 30
-                if((accumulatedDSV < THRESHOLD_DSV_MAX) && (accumulatedDSV >= (THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX)) )
-                {
+                if ((accumulatedDSV < THRESHOLD_DSV_MAX)
+                        && (accumulatedDSV >= (THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX))) {
                     result = Result.WARNING_STATUS_MINOR_RISK;
-                }
-                else
-                {
-                    if(accumulatedDSV < (THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX))
-                    {
+                } else {
+                    if (accumulatedDSV < (THRESHOLD_DSV_MAX - THRESHOLD_DSV_DIFF_MIN_MAX)) {
                         result = Result.WARNING_STATUS_NO_RISK;
                     }
 
                 }
 
             }
+        } else {
+            result = Result.WARNING_STATUS_NO_WARNING_MISSING_DATA;
+
         }
-        else
-        {
-             result = Result.WARNING_STATUS_NO_WARNING_MISSING_DATA;
-             
-        }
-        
+
         return result;
     }
+
 }
diff --git a/src/main/java/no/nibio/vips/model/alternariamodel/DataMatrix.java b/src/main/java/no/nibio/vips/model/alternariamodel/DataMatrix.java
index 6b5588f5885b2122f5df521b595120cfbeec4ccc..da06416bf74ca3ee1c64aa33e086f381626e9087 100644
--- a/src/main/java/no/nibio/vips/model/alternariamodel/DataMatrix.java
+++ b/src/main/java/no/nibio/vips/model/alternariamodel/DataMatrix.java
@@ -3,7 +3,7 @@
  * Organization			:	NIBIO, Ås
  * Department			:	VIPS
  * 
- * Author			:	bhabesh
+ * Author			:	bhabesh & Tor-Einar Skog
  *
  * 
  * File Name			:	DataMatrix.java
@@ -16,22 +16,23 @@
  */
 /*
  * 
-
-Copyright (c) 2016 NIBIO <http://www.nibio.no/>. 
-            
-This file is part of AlternariaModel.  
-AlternariaModel is free software: you can redistribute it and/or modify  
-it under the terms of the NIBIO Open Source License as published by  
-NIBIO, either version 1 of the License, or (at your option) any 
-later version. 
-
-AlternariaModel is distributed in the hope that it will be useful, 
-but WITHOUT ANY WARRANTY; without even the implied warranty of 
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
-NIBIO Open Source License for more details. 
-
-You should have received a copy of the NIBIO Open Source License 
-along with AlternariaModel.  If not, see <http://www.nibio.no/licenses/>.
+ * 
+ * Copyright (c) 2020-2024 NIBIO <http://www.nibio.no/>. 
+ *             
+ * This file is part of AlternariaModel.  
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
  */
 
@@ -42,6 +43,7 @@ import no.nibio.vips.util.DateMap;
 /**
  *
  * @author bhabesh
+ * @author Tor-Einar Skog <tor-einar.skog@nibio.no>
  */
 public class DataMatrix extends DateMap{
     public final static String  WET_HOUR                        =   "WH";           //  Leaf wetness 2 m, minutes per hour
@@ -53,8 +55,8 @@ public class DataMatrix extends DateMap{
     public final static String  SPRAYING_DATE                   =   "sprayingDate"; //   Spray Date
     
     public final static String  THRESHOLD_DSV_BASE              =   "THRESHOLD_DSV_BASE"; //   THRESHOLD_DSV_BASE
-    public final static String  THRESHOLD_DSV_MAX               =   "THRESHOLD_DSV_MAX"; //   THRESHOLD_DSV_MAX
-
+    public final static String  THRESHOLD_DSV_MAX               =   "thresholdDSVMax"; //   THRESHOLD_DSV_MAX
+    public final static String THRESHOLD_DSV_TEMP_MIN           =   "thresholdDSVTempMin";
     
     
     
diff --git a/src/main/resources/LICENSE_header.txt b/src/main/resources/LICENSE_header.txt
new file mode 100644
index 0000000000000000000000000000000000000000..76e92f2831f909ba16f7b688ec4a83ed204f5929
--- /dev/null
+++ b/src/main/resources/LICENSE_header.txt
@@ -0,0 +1,16 @@
+
+
+    Copyright (C) 2024 Tor-Einar Skog <tor-einar.skog@nibio.no>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
diff --git a/src/main/resources/no/nibio/vips/model/alternariamodel/texts.properties b/src/main/resources/no/nibio/vips/model/alternariamodel/texts.properties
index e3e34950884c015ce4193aea08ba506ced146243..ff1798cdeb9ed91d7c4b5e843732c1d32957ba74 100644
--- a/src/main/resources/no/nibio/vips/model/alternariamodel/texts.properties
+++ b/src/main/resources/no/nibio/vips/model/alternariamodel/texts.properties
@@ -26,35 +26,3 @@ observations - list of weather data. The following parameters are required:\n\
 * TM - Average temperature (Degrees Celcius)\n\
 * BT - Leaf wetness (Minutes/hour) (IF you don't have leaf wetness, you must provide UM (relative humidity). Then we will calculate the leaf wetness.\n\
 sprayingDate - (Optional) Farmers can choose multiple spraying dates (upto four spraying dates).
-license= Copyright (c) 2020 NIBIO <http://www.nibio.no/>. \n            \nThis file is part of AlternariaModel.  \nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-sampleconfig={                                                          \n\
-\t    "loginInfo": {                                                      \n\
-\t\t        "username": "example",                                          \n\
-\t\t        "password": "example"                                           \n\
-\t    },                                                                  \n\
-\t    "modelId": "ALTERNARIA",                                            \n\
-\t    "configParameters": {                                               \n\
-\t        "timeZone": "Europe/Oslo",                                      \n\
-\t        "observations": [                                               \n\
-\t            {                                                           \n\
-\t\t                "elementMeasurementTypeId": "TM",                       \n\
-\t\t                "logIntervalId": 1,                                     \n\
-\t\t                "timeMeasured": "2018-08-11T00:00:00+02:00",            \n\
-\t\t                "value": 10.46                                          \n\
-\t            },                                                          \n\
-\t            {                                                           \n\
-\t\t                "elementMeasurementTypeId": "BT",                       \n\
-\t\t                "logIntervalId": 1,                                     \n\
-\t\t                "timeMeasured": "2018-08-11T00:00:00+02:00",            \n\
-\t\t                "value": 60.0                                           \n\
-\t            }                                                           \n\
-\t        ],                                                               \n\
-\t        "sprayingDates": [                                                \n\
-\t\t            "2018-07-02T22:00:00Z",                                     \n\
-\t\t            "2018-07-30T22:00:00Z",                                     \n\
-\t\t            "2018-09-04T22:00:00Z"                                      \n\
-\t        ]                                                                 \n\
-\t    }                                                                   \n\
- }                                                                      \n\
-
diff --git a/src/main/resources/no/nibio/vips/model/alternariamodel/texts_nb.properties b/src/main/resources/no/nibio/vips/model/alternariamodel/texts_nb.properties
index b79332c1e0a8f2aad8ebeb49f93295e6aded08a1..0fa4f36aee3246c03e7cdac84319f27098e65653 100644
--- a/src/main/resources/no/nibio/vips/model/alternariamodel/texts_nb.properties
+++ b/src/main/resources/no/nibio/vips/model/alternariamodel/texts_nb.properties
@@ -19,4 +19,3 @@ name=TOMCAST (FAST - Dew) modell for Alternaria
 description=  <p>{{filename="/images/ef-20200421-altenaria.jpg" description="Photo: Bilde: S. Abrahamsen, NLR"}}</p>\n<p>TOMCAST er basert p&aring; en modell utviklet for varsling av bladflekksjukdommer i tomat. Versjonen som blir brukt her er testet og tilpasset t&oslash;rrflekksjuke i potet (Alternaria solani) i Danmark. Modellen beregner daglige risikoverdier (DSV: Disease Severity Value) basert p&aring; temperatur og bladfuktighet siste d&oslash;gn. DSV representerer risikoen for angrep av t&oslash;rrflekksjuke siste d&oslash;gn. Daglige DSV-verdier blir summert frem til en terskel er n&aring;dd og behandling er anbefalt. Modellen er laget slik at akkumulering av DSV nullstilles n&aring;r spr&oslash;yting gjennomf&oslash;res, og akkumulering starter p&aring; nytt fra 0.</p>\n<p>Modellen er under utpr&oslash;ving i 2020, og vil bli testet b&aring;de i gulrot og i potet. Det vil kun v&aelig;re mulig &aring; starte private varler for denne modellen. Basert p&aring; erfaringer fra andre land er terskelverdien for r&oslash;dt varsel satt til 20.</p>\n<h3>Oppstart av varsel</h3>\n<p>Potetplanter varierer i mottakelighet for t&oslash;rrflekksjuke gjennom sesongen, og de blir gradvis mer og mer mottakelige. Dette betyr at behovet for beskyttelse ogs&aring; varierer tilsvarende. Modellen startes n&aring;r man ser de f&oslash;rste symptomene p&aring; t&oslash;rrflekksjuke og gjennomf&oslash;rer f&oslash;rste behandling (under 0,1% angrep).</p>\n<h3>Tolking av varsel</h3>\n<p>Modellen vil vise gr&oslash;nt (ingen fare) frem til den akkumulerte risikoverdien er 15. Fra denne verdien frem til terskelverdien (20) vil varselet v&aelig;re gult (mulig fare), og deretter g&aring; over til r&oslash;dt (fare).</p>
 statusInterpretation=Modellen vil vise gr\u00f8nt (ingen fare) frem til den akkumulerte risikoverdien er 15. Fra denne verdien frem til terskelverdien (20) vil varselet v\u00e6re gult (mulig fare), og deretter g\u00e5 over til r\u00f8dt (fare).
 usage=TODO
-license=Copyright (c) 2020 NIBIO <http://www.nibio.no/>. \n            \nThis file is part of AlternariaModel.  \nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>.
diff --git a/src/main/resources/sample_config.json b/src/main/resources/sample_config.json
new file mode 100644
index 0000000000000000000000000000000000000000..f71ed86a614d6f6c1e65183bb8db332766599764
--- /dev/null
+++ b/src/main/resources/sample_config.json
@@ -0,0 +1,31 @@
+{
+    "loginInfo": {
+        "username": "example",
+        "password": "example"
+    },
+    "modelId": "ALTERNARIA",
+    "configParameters": {
+        "sprayingDates": [
+            "2018-07-02T22:00:00Z",
+            "2018-07-30T22:00:00Z",
+            "2018-09-04T22:00:00Z"
+        ],
+        "thresholdDSVTempMin": "10.0",
+        "thresholdDSVMax": "20.0",
+        "timeZone": "Europe/Oslo",
+        "observations": [
+            {
+                "elementMeasurementTypeId": "TM",
+                "logIntervalId": 1,
+                "timeMeasured": "2018-08-11T00:00:00+02:00",
+                "value": 10.46
+            },
+            {
+                "elementMeasurementTypeId": "BT",
+                "logIntervalId": 1,
+                "timeMeasured": "2018-08-11T00:00:00+02:00",
+                "value": 60
+            }
+        ]
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/no/nibio/vips/model/alternariamodel/AlternariaModelTest.java b/src/test/java/no/nibio/vips/model/alternariamodel/AlternariaModelTest.java
index 4e160a32bad462f31b4a132b3bf442da2277f8b1..001010c8ad7f5cd475ce5bedadac331965bcb319 100644
--- a/src/test/java/no/nibio/vips/model/alternariamodel/AlternariaModelTest.java
+++ b/src/test/java/no/nibio/vips/model/alternariamodel/AlternariaModelTest.java
@@ -1,7 +1,19 @@
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright (c) 2020 NIBIO <http://www.nibio.no/>. 
+            
+This file is part of AlternariaModel.  
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 package no.nibio.vips.model.alternariamodel;
 
@@ -25,6 +37,7 @@ import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.BeforeAll;
 import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.DynamicTest.stream;
 
 /**
  *
@@ -104,6 +117,90 @@ public class AlternariaModelTest {
        */ 
         
         
+    }
+
+    @org.junit.jupiter.api.Test
+    public void testGetResultWithThresholdDSVTempMin() throws Exception {
+        System.out.println("getResultWithThresholdDSVTempMin");
+        ModelConfiguration config   = this.getConfiguration(getWeatherDataFile());
+        config.setConfigParameter("sprayingDates", this.getConfigurationSprayingDates(getResetDataFile())); 
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_TEMP_MIN, 10.0);
+        AlternariaModel instance = new AlternariaModel();
+        instance.setConfiguration(config);
+        List<Result> result = instance.getResult();
+        assertNotNull(result);
+       
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_TEMP_MIN, "10.0");
+
+        instance.setConfiguration(config);
+        result = instance.getResult();
+        assertNotNull(result);
+       
+        /* 
+        for(Result res:result)
+        {
+            // LOGGER.log(Level.INFO, res.toString());
+            System.out.println(res.toString());
+        }*/
+
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_TEMP_MIN, "13.0");
+        //System.out.println(config.toJSON());
+
+        instance.setConfiguration(config);
+        result = instance.getResult();
+        assertNotNull(result);
+       
+        /*
+        for(Result res:result)
+        {
+            // LOGGER.log(Level.INFO, res.toString());
+            System.out.println(res.toString());
+        } */
+        
+        
+        
+    }
+
+    @org.junit.jupiter.api.Test
+    public void testGetResultWithThresholdDSVMax() throws Exception {
+        System.out.println("getResultWithThresholdDSVMax");
+        ModelConfiguration config   = this.getConfiguration(getWeatherDataFile());
+        config.setConfigParameter("sprayingDates", this.getConfigurationSprayingDates(getResetDataFile())); 
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_MAX, 21);
+        AlternariaModel instance = new AlternariaModel();
+        instance.setConfiguration(config);
+        List<Result> result = instance.getResult();
+        assertNotNull(result);
+       
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_MAX, "21");
+
+        instance.setConfiguration(config);
+        result = instance.getResult();
+        assertNotNull(result);
+       
+        /* 
+        for(Result res:result)
+        {
+            // LOGGER.log(Level.INFO, res.toString());
+            System.out.println(res.toString());
+        }*/
+
+        config.setConfigParameter(DataMatrix.THRESHOLD_DSV_MAX, "13.0");
+        //System.out.println(config.toJSON());
+
+        instance.setConfiguration(config);
+        result = instance.getResult();
+        assertNotNull(result);
+       
+        /*
+        for(Result res:result)
+        {
+            // LOGGER.log(Level.INFO, res.toString());
+            System.out.println(res.toString());
+        } */
+        
+        
+        
     }
 
     /**
@@ -149,9 +246,8 @@ public class AlternariaModelTest {
     public void testGetLicense() {
         System.out.println("getLicense");
         AlternariaModel instance = new AlternariaModel();
-        String expResult = "";
         String result = instance.getLicense();
-        assertNotNull(result);
+        assertTrue(result.contains("GNU Affero"));
     }
 
     /**
@@ -251,15 +347,13 @@ public class AlternariaModelTest {
 
     /**
      * Test of getSampleConfig method, of class AlternariaModel.
-     * TODO - Recheck the functionality
      */
     @org.junit.jupiter.api.Test
     public void testGetSampleConfig() {
         System.out.println("getSampleConfig");
         AlternariaModel instance = new AlternariaModel();
-        String expResult = "";
         String result = instance.getSampleConfig();
-        assertNotNull(result);
+        assertTrue(result.contains("configParameters"));
     }
 
     /**