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

Adjusted test to check for DST transitions

parent a4835580
No related branches found
No related tags found
No related merge requests found
target/
classes/
*~
......@@ -61,9 +61,9 @@ public class OatFloweringModel extends I18nImpl implements Model{
Double dayDegreeSum = 0.0;
List<Result> results = new ArrayList<>();
boolean z60Set = false, z625Set = false, z69Set = false;
//System.out.println("TM size=" + TM.size());
for(WeatherObservation obs:this.TM)
{
System.out.println("Running");
if(obs.getTimeMeasured().compareTo(dateOfSowing) >= 0
&& obs.getValue() > 0)
{
......@@ -211,6 +211,7 @@ public class OatFloweringModel extends I18nImpl implements Model{
case WeatherElements.TEMPERATURE_MEAN:
if(o.getLogIntervalId().equals(WeatherObservation.LOG_INTERVAL_ID_1D))
{
System.out.println("Adding TM");
this.TM.add(o);
}
break;
......
......@@ -130,19 +130,21 @@ public class OatFloweringModelTest {
if(all.isArray())
{
for(JsonNode node : all){
System.out.println(node.toString());
Date timeMeasured = (Date)mapper.convertValue(node.get("timeMeasured").getTextValue(), new TypeReference<Date>(){});
if(firstDate == null || firstDate.compareTo(timeMeasured) > 0)
{
firstDate = timeMeasured;
}
//System.out.println(node.toString());
System.out.println(node.get("elementMeasurementTypeId"));
WeatherObservation observation = new WeatherObservation();
observation.setTimeMeasured(timeMeasured);
observation.setLogIntervalId(node.get("logIntervalId").getIntValue());
observation.setLogIntervalId(Integer.valueOf(node.get("logIntervalId").getTextValue()));
observation.setElementMeasurementTypeId(node.get("elementMeasurementTypeId").getTextValue());
observation.setValue(node.get("value").getDoubleValue());
observation.setValue(Double.valueOf(node.get("value").getTextValue()));
observations.add(observation);
System.out.println("logIntevalId=" + observation.getLogIntervalId());
}
}
......@@ -152,7 +154,7 @@ public class OatFloweringModelTest {
}
config.setConfigParameter("observations", observations);
config.setConfigParameter("dateOfSowing", firstDate);
System.out.println("dateOfSowing = " + firstDate);
return config;
} catch (IOException ex) {
......
This diff is collapsed.
[
{"timeMeasured": "2014-04-01T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":2.27117391304348},
{"timeMeasured": "2014-04-02T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":4.11325},
{"timeMeasured": "2014-04-03T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":3.8994},
{"timeMeasured": "2014-04-04T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":2.944},
{"timeMeasured": "2014-04-05T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":0.661375},
{"timeMeasured": "2014-04-06T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":4.766125},
{"timeMeasured": "2014-04-07T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":7.769125},
{"timeMeasured": "2014-04-08T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.99891666666667},
{"timeMeasured": "2014-04-09T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":2.80245833333333},
{"timeMeasured": "2014-04-10T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":3.15925},
{"timeMeasured": "2014-04-11T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.15741666666667},
{"timeMeasured": "2014-04-12T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":3.96670833333333},
{"timeMeasured": "2014-04-13T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":7.102375},
{"timeMeasured": "2014-04-14T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.38904166666666},
{"timeMeasured": "2014-04-15T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.71329166666667},
{"timeMeasured": "2014-04-16T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.43008333333333},
{"timeMeasured": "2014-04-17T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.65616666666667},
{"timeMeasured": "2014-04-18T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":7.07616666666667},
{"timeMeasured": "2014-04-19T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.88533333333333},
{"timeMeasured": "2014-04-20T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":8.78733333333333},
{"timeMeasured": "2014-04-21T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":11.3544166666667},
{"timeMeasured": "2014-04-22T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":12.8357083333333},
{"timeMeasured": "2014-04-23T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":10.7384583333333},
{"timeMeasured": "2014-04-24T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":7.11995833333333},
{"timeMeasured": "2014-04-25T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":8.52258333333334},
{"timeMeasured": "2014-04-26T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":10.62575},
{"timeMeasured": "2014-04-27T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":12.5907083333333},
{"timeMeasured": "2014-04-28T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":12.268},
{"timeMeasured": "2014-04-29T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.748125},
{"timeMeasured": "2014-04-30T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.34483333333333},
{"timeMeasured": "2014-05-01T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.19366666666667},
{"timeMeasured": "2014-05-02T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.45320833333333},
{"timeMeasured": "2014-05-03T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.42604166666667},
{"timeMeasured": "2014-05-04T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.42966666666667},
{"timeMeasured": "2014-05-05T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.24733333333333},
{"timeMeasured": "2014-05-06T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":6.02966666666667},
{"timeMeasured": "2014-05-07T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":3.8485416666667},
{"timeMeasured": "2014-05-08T01:00:00+02:00","elementMeasurementTypeId":"TM", "logIntervalId":3, "value":5.8916666666667}]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment