diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/grid/preprocessor/ZymoseptoriaSimpleRiskGridModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/grid/preprocessor/ZymoseptoriaSimpleRiskGridModelPreprocessor.java index 2abdd427b32ebc2f2e4c6c1d5c9930c08b20634f..6b4d3b280697aa0c545bc3b520ce88d237206be9 100644 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/grid/preprocessor/ZymoseptoriaSimpleRiskGridModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/grid/preprocessor/ZymoseptoriaSimpleRiskGridModelPreprocessor.java @@ -120,7 +120,7 @@ public class ZymoseptoriaSimpleRiskGridModelPreprocessor extends ModelRunPreproc station, WeatherObservation.LOG_INTERVAL_ID_1H, new String[]{ - WeatherElements.LEAF_WETNESS, + WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.RELATIVE_HUMIDITY_MEAN, WeatherElements.PRECIPITATION, WeatherElements.TEMPERATURE_MEAN diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/AppleScabModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/AppleScabModelPreprocessor.java index 4de8ad02e8880b4c2701fc7623314fe42f6dd3ee..c86453bc76e1d9c5e458c084fb8d41f5aaeef51f 100755 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/AppleScabModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/AppleScabModelPreprocessor.java @@ -106,7 +106,7 @@ public class AppleScabModelPreprocessor extends ModelRunPreprocessor{ new String[]{ WeatherElements.TEMPERATURE_MEAN, WeatherElements.PRECIPITATION, - WeatherElements.LEAF_WETNESS, + WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.RELATIVE_HUMIDITY_MEAN }, startDateAscosporeMaturity, @@ -222,7 +222,7 @@ public class AppleScabModelPreprocessor extends ModelRunPreprocessor{ { switch(o.getElementMeasurementTypeId()) { - case WeatherElements.LEAF_WETNESS: + case WeatherElements.LEAF_WETNESS_DURATION: BT.add(o); break; case WeatherElements.RELATIVE_HUMIDITY_MEAN: diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/BremiaLactucaeModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/BremiaLactucaeModelPreprocessor.java index e65356ddcfafa2a05ff55b4810280f4722cf1c65..55fdb4cc716b08e6d814276df5e99141dad9db2a 100755 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/BremiaLactucaeModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/BremiaLactucaeModelPreprocessor.java @@ -57,8 +57,8 @@ public class BremiaLactucaeModelPreprocessor extends ModelRunPreprocessor { weatherStation, WeatherObservation.LOG_INTERVAL_ID_1H, new String[]{ - WeatherElements.LEAF_WETNESS, - WeatherElements.LEAF_WETNESS_GROUND_LEVEL, + WeatherElements.LEAF_WETNESS_DURATION, + WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL, WeatherElements.TEMPERATURE_MAXIMUM, WeatherElements.GLOBAL_RADIATION, WeatherElements.RELATIVE_HUMIDITY_MEAN, @@ -68,8 +68,8 @@ public class BremiaLactucaeModelPreprocessor extends ModelRunPreprocessor { configuration.getDateStartInTimeZone(), configuration.getDateEndInTimeZone()); observations = wUtil.checkForAndFixHourlyTimeSeriesHoles(observations); - List<WeatherObservation> BTg = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_GROUND_LEVEL))); - List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS))); + List<WeatherObservation> BTg = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL))); + List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_DURATION))); List<WeatherObservation> TX = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.TEMPERATURE_MAXIMUM))); List<WeatherObservation> Q0 = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.GLOBAL_RADIATION))); List<WeatherObservation> UM = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.RELATIVE_HUMIDITY_MEAN))); @@ -83,7 +83,7 @@ public class BremiaLactucaeModelPreprocessor extends ModelRunPreprocessor { { BTg = wUtil.calculateLeafWetnessHourSeriesBestEffort(BTg,TM, RR, null,null, UM); } - wUtil.renameParameter(BTg, WeatherElements.LEAF_WETNESS, WeatherElements.LEAF_WETNESS_GROUND_LEVEL); + wUtil.renameParameter(BTg, WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL); observations = new ArrayList<>(); observations.addAll(BTg); diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/DOWNCASTModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/DOWNCASTModelPreprocessor.java index 33d3332bf4b90f6fb86cdddb1ae4808ca072be2e..e5d12c74f1ba7c07b4a861dcd82ccea81fe081cc 100755 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/DOWNCASTModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/DOWNCASTModelPreprocessor.java @@ -56,8 +56,8 @@ public class DOWNCASTModelPreprocessor extends ModelRunPreprocessor{ weatherStation, WeatherObservation.LOG_INTERVAL_ID_1H, new String[]{ - WeatherElements.LEAF_WETNESS, - WeatherElements.LEAF_WETNESS_GROUND_LEVEL, + WeatherElements.LEAF_WETNESS_DURATION, + WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL, WeatherElements.RELATIVE_HUMIDITY_MEAN, WeatherElements.PRECIPITATION, WeatherElements.TEMPERATURE_MEAN @@ -65,8 +65,8 @@ public class DOWNCASTModelPreprocessor extends ModelRunPreprocessor{ configuration.getDateStartInTimeZone(), configuration.getDateEndInTimeZone()); observations = wUtil.checkForAndFixHourlyTimeSeriesHoles(observations); - List<WeatherObservation> BTg = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_GROUND_LEVEL))); - List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS))); + List<WeatherObservation> BTg = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL))); + List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_DURATION))); List<WeatherObservation> UM = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.RELATIVE_HUMIDITY_MEAN))); List<WeatherObservation> RR = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.PRECIPITATION))); List<WeatherObservation> TM = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.TEMPERATURE_MEAN))); @@ -78,7 +78,7 @@ public class DOWNCASTModelPreprocessor extends ModelRunPreprocessor{ { BTg = wUtil.calculateLeafWetnessHourSeriesBestEffort(BTg,TM, RR, null,null, UM); } - wUtil.renameParameter(BTg, WeatherElements.LEAF_WETNESS, WeatherElements.LEAF_WETNESS_GROUND_LEVEL); + wUtil.renameParameter(BTg, WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.LEAF_WETNESS_DURATION_GROUND_LEVEL); observations = new ArrayList<>(); observations.addAll(BTg); diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/NaerstadModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/NaerstadModelPreprocessor.java index ce971de0b628c9c4de8366f418e4b863bcaf8eb7..7fbed9f1cd7e8b5b76c585dcb0c514ddd8a1bd37 100755 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/NaerstadModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/NaerstadModelPreprocessor.java @@ -89,7 +89,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{ new String[]{ WeatherElements.TEMPERATURE_MEAN, WeatherElements.PRECIPITATION, - WeatherElements.LEAF_WETNESS, + WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.RELATIVE_HUMIDITY_MEAN, WeatherElements.GLOBAL_RADIATION, WeatherElements.WIND_SPEED_2M @@ -194,7 +194,7 @@ public class NaerstadModelPreprocessor extends ModelRunPreprocessor{ { switch(o.getElementMeasurementTypeId()) { - case WeatherElements.LEAF_WETNESS: + case WeatherElements.LEAF_WETNESS_DURATION: BT.add(o); break; diff --git a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/SeptoriaApiicolaModelPreprocessor.java b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/SeptoriaApiicolaModelPreprocessor.java index 6fcab9c6a3312d11c4b5c8765f9dd887128a6cd9..8186262eacb50082c8bf81fc00f879a6acc84d3f 100755 --- a/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/SeptoriaApiicolaModelPreprocessor.java +++ b/src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/SeptoriaApiicolaModelPreprocessor.java @@ -70,7 +70,7 @@ public class SeptoriaApiicolaModelPreprocessor extends ModelRunPreprocessor { weatherStation, WeatherObservation.LOG_INTERVAL_ID_1H, new String[]{ - WeatherElements.LEAF_WETNESS, + WeatherElements.LEAF_WETNESS_DURATION, WeatherElements.TEMPERATURE_MEAN, WeatherElements.PRECIPITATION, WeatherElements.RELATIVE_HUMIDITY_MEAN @@ -78,7 +78,7 @@ public class SeptoriaApiicolaModelPreprocessor extends ModelRunPreprocessor { configuration.getDateStartInTimeZone(), configuration.getDateEndInTimeZone()); observations = wUtil.checkForAndFixHourlyTimeSeriesHoles(observations); - List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS))); + List<WeatherObservation> BT = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.LEAF_WETNESS_DURATION))); List<WeatherObservation> TM = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.TEMPERATURE_MEAN))); List<WeatherObservation> RR = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.PRECIPITATION))); List<WeatherObservation> UM = wUtil.filterWeatherObservationsByParameter(observations, new HashSet(Arrays.asList(WeatherElements.RELATIVE_HUMIDITY_MEAN))); diff --git a/src/main/java/no/nibio/vips/logic/service/ModelFormService.java b/src/main/java/no/nibio/vips/logic/service/ModelFormService.java index 3a00a583c3c5499536ece87dc2298010cb88c671..56ddefe8bf63694c9ccd4d100705040de9b76463 100644 --- a/src/main/java/no/nibio/vips/logic/service/ModelFormService.java +++ b/src/main/java/no/nibio/vips/logic/service/ModelFormService.java @@ -150,7 +150,7 @@ public class ModelFormService { WeatherElements.TEMPERATURE_MEAN, WeatherElements.PRECIPITATION, WeatherElements.RELATIVE_HUMIDITY_MEAN, - WeatherElements.LEAF_WETNESS + WeatherElements.LEAF_WETNESS_DURATION }, startTime, endTime diff --git a/src/main/java/no/nibio/vips/util/weather/MetosAPIDataParser.java b/src/main/java/no/nibio/vips/util/weather/MetosAPIDataParser.java index 0a11e35fbe18eb6c0dbf9d18e8aeb3fb8b38a2b9..14a64364e4bb624d96edde177bd046cfcd008698 100644 --- a/src/main/java/no/nibio/vips/util/weather/MetosAPIDataParser.java +++ b/src/main/java/no/nibio/vips/util/weather/MetosAPIDataParser.java @@ -78,7 +78,7 @@ public class MetosAPIDataParser { // TODO; Separate parameter: Soil temperature. Search for name "Soil temperature", higher channel number = deeper sensor private final ParamInfo[] PARAM_MAP = { new ParamInfo(WeatherElements.PRECIPITATION, new Integer[] {6}, "sum"), - new ParamInfo(WeatherElements.LEAF_WETNESS, new Integer[] {4}, "time"), + new ParamInfo(WeatherElements.LEAF_WETNESS_DURATION, new Integer[] {4}, "time"), new ParamInfo(WeatherElements.GLOBAL_RADIATION, new Integer[] {600}, "avg"), new ParamInfo(WeatherElements.WIND_SPEED_2M, new Integer[] {5}, "avg"), new ParamInfo(WeatherElements.TEMPERATURE_MEAN, new Integer[] {0,16385}, "avg"), diff --git a/src/main/java/no/nibio/vips/util/weather/dnmipointweb/DMIPointWebDataParser.java b/src/main/java/no/nibio/vips/util/weather/dnmipointweb/DMIPointWebDataParser.java index cff4c3f00ae0fdc0ead4446b2ecb86b14acbe5e8..57f45b59e7886df92027855cb6104e6db458b356 100644 --- a/src/main/java/no/nibio/vips/util/weather/dnmipointweb/DMIPointWebDataParser.java +++ b/src/main/java/no/nibio/vips/util/weather/dnmipointweb/DMIPointWebDataParser.java @@ -56,7 +56,7 @@ public class DMIPointWebDataParser { PARAM_MAP.put(WeatherElements.RELATIVE_HUMIDITY_MEAN, WeatherDataParameter.AIRRH); PARAM_MAP.put(WeatherElements.WIND_SPEED_2M, WeatherDataParameter.WINDSPEED); PARAM_MAP.put(WeatherElements.SOIL_TEMPERATURE_10CM_MEAN, WeatherDataParameter.SOILTEMP); - PARAM_MAP.put(WeatherElements.LEAF_WETNESS, WeatherDataParameter.LEAFWET); + PARAM_MAP.put(WeatherElements.LEAF_WETNESS_DURATION, WeatherDataParameter.LEAFWET); } @@ -174,7 +174,7 @@ public class DMIPointWebDataParser { obs.setValue(wDataModel.getSoiltemp().getValue()); break;// Not sure if it's 10 or 5 cm depth yet case WeatherElements.SOIL_TEMPERATURE_5CM_MEAN: obs.setValue(wDataModel.getSoiltemp().getValue()); break; - case WeatherElements.LEAF_WETNESS: + case WeatherElements.LEAF_WETNESS_DURATION: obs.setValue(wDataModel.getLeafwet().getValue()); break; default: return null; } diff --git a/src/test/java/no/nibio/vips/logic/test/mock/MockModel.java b/src/test/java/no/nibio/vips/logic/test/mock/MockModel.java index 140a7d04549d6ee213905ab9872d32b8c285ae50..022dab95728cd1a68831ce407bee99bd969545d8 100644 --- a/src/test/java/no/nibio/vips/logic/test/mock/MockModel.java +++ b/src/test/java/no/nibio/vips/logic/test/mock/MockModel.java @@ -102,7 +102,7 @@ public class MockModel implements Model{ { wetHoursForDay[0]++; // We add up the number of hours we actually have weather data for } - Double BT = pointMatrix.getParamDoubleValueForDate(timestamp, WeatherElements.LEAF_WETNESS); + Double BT = pointMatrix.getParamDoubleValueForDate(timestamp, WeatherElements.LEAF_WETNESS_DURATION); Double RR = pointMatrix.getParamDoubleValueForDate(timestamp, WeatherElements.PRECIPITATION); if(TM >= 10.0) {