Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_SEPTORIAHU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
Models
Java
Model_SEPTORIAHU
Commits
b5179878
Commit
b5179878
authored
7 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Added more result parameters
parent
d3b0f810
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/model/septoriahumiditymodel/SeptoriaHumidityModel.java
+5
-60
5 additions, 60 deletions
...ps/model/septoriahumiditymodel/SeptoriaHumidityModel.java
with
5 additions
and
60 deletions
src/main/java/no/nibio/vips/model/septoriahumiditymodel/SeptoriaHumidityModel.java
+
5
−
60
View file @
b5179878
...
...
@@ -93,7 +93,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
Boolean
humidPeriodStarted
=
false
;
Integer
humidPeriodHour
=
0
;
// This excludes dates before gs32 and inside protection periods
Integer
humidPeriodHour
i
nSusceptiblePhase
=
0
;
Integer
humidPeriodHour
I
nSusceptiblePhase
=
0
;
while
(
currentDate
.
compareTo
(
lastDate
)
<=
0
){
Double
RR
=
this
.
dataMatrix
.
getParamDoubleValueForDate
(
currentDate
,
DataMatrix
.
RR
);
Double
UM
=
this
.
dataMatrix
.
getParamDoubleValueForDate
(
currentDate
,
DataMatrix
.
UM
);
...
...
@@ -116,11 +116,11 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
humidPeriodHour
=
humidHour
==
1
?
humidPeriodHour
+
1
:
0
;
this
.
dataMatrix
.
setParamIntValueForDate
(
currentDate
,
DataMatrix
.
HPH
,
humidPeriodHour
);
humidPeriodHour
i
nSusceptiblePhase
=
humidPeriodHour
I
nSusceptiblePhase
=
humidHour
==
1
&&
!
DateTimeInterval
.
isDateInIntervals
(
currentDate
,
this
.
protectionPeriods
)
&&
currentDate
.
after
(
this
.
date3rdUpperLeafEmerging
)
?
humidPeriodHour
i
nSusceptiblePhase
+
1
:
0
;
?
humidPeriodHour
I
nSusceptiblePhase
+
1
:
0
;
cal
.
setTime
(
currentDate
);
cal
.
add
(
Calendar
.
HOUR_OF_DAY
,
-
this
.
slidingHoursAhead
);
...
...
@@ -133,8 +133,9 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
r
.
setValidTimeStart
(
new
Date
(
currentDate
.
getTime
()));
r
.
setWarningStatus
(
currentDate
.
after
(
this
.
date3rdUpperLeafEmerging
)
&&
currentDate
.
before
(
this
.
dateGs75
)
?
Result
.
WARNING_STATUS_NO_RISK
:
Result
.
WARNING_STATUS_NO_WARNING
);
r
.
setValue
(
SeptoriaHumidityModel
.
MODEL_ID
.
toString
(),
DataMatrix
.
HPH
,
String
.
valueOf
(
humidPeriodHour
));
r
.
setValue
(
SeptoriaHumidityModel
.
MODEL_ID
.
toString
(),
DataMatrix
.
HPHPP
,
String
.
valueOf
(
humidPeriodHour
i
nSusceptiblePhase
));
r
.
setValue
(
SeptoriaHumidityModel
.
MODEL_ID
.
toString
(),
DataMatrix
.
HPHPP
,
String
.
valueOf
(
humidPeriodHour
I
nSusceptiblePhase
));
r
.
setValue
(
SeptoriaHumidityModel
.
MODEL_ID
.
toString
(),
DataMatrix
.
HH
,
String
.
valueOf
(
humidHour
));
r
.
setValue
(
SeptoriaHumidityModel
.
MODEL_ID
.
toString
(),
DataMatrix
.
HHS
,
String
.
valueOf
(
slidingWindowSum
));
r
.
setValue
(
CommonNamespaces
.
NS_WEATHER
,
WeatherElements
.
LEAF_WETNESS
,
String
.
valueOf
(
this
.
dataMatrix
.
getParamDoubleValueForDate
(
currentDate
,
DataMatrix
.
BT
)));
r
.
setValue
(
CommonNamespaces
.
NS_WEATHER
,
WeatherElements
.
RELATIVE_HUMIDITY_MEAN
,
String
.
valueOf
(
this
.
dataMatrix
.
getParamDoubleValueForDate
(
currentDate
,
DataMatrix
.
UM
)));
r
.
setValue
(
CommonNamespaces
.
NS_WEATHER
,
WeatherElements
.
PRECIPITATION
,
String
.
valueOf
(
this
.
dataMatrix
.
getParamDoubleValueForDate
(
currentDate
,
DataMatrix
.
RR
)));
...
...
@@ -165,63 +166,7 @@ public class SeptoriaHumidityModel extends I18nImpl implements Model {
}
humidHoursConsecutive
.
clear
();
}
/*
// Decide the warning status
r.setWarningStatus(Result.WARNING_STATUS_NO_WARNING);
if(currentDate.compareTo(this.date3rdUpperLeafEmerging) >= 0 && currentDate.compareTo(this.dateGs75) <= 0)
{
if(humidPeriodHourOutsideProtectionPeriod > this.thresholdHumidPeriodHours)
{
r.setWarningStatus(Result.WARNING_STATUS_HIGH_RISK);
//humidPeriodStarted = Boolean.TRUE;
}
else
{
r.setWarningStatus(Result.WARNING_STATUS_NO_RISK);
}
}*/
/*Optional<Result> previousR = retVal.stream().filter(res->res.getValidTimeStart().compareTo(middleOfSlidingWindowDate) == 0).findFirst();
if(previousR.isPresent()){
Result inTheMiddleR = previousR.get();
inTheMiddleR.setValue(SeptoriaHumidityModel.MODEL_ID.toString(), DataMatrix.HHS, slidingWindowSum.toString());
// Here we also decide the warning status
// If growth stage > 32 (date of 3rd upper leaf emerging)
// Account for all leaves being alive (75 days from emerging?)
// And we have a humid period (19 consecutive hours) -> Treatment
// If treatment, no risk until x days after treatment
// Challenge
if(inTheMiddleR.getValidTimeStart().compareTo(this.date3rdUpperLeafEmerging) >= 0
&& inTheMiddleR.getValidTimeStart().compareTo(this.dateGs75) <= 0
)
{
if(humidPeriodStarted)
{
inTheMiddleR.setWarningStatus(Result.WARNING_STATUS_HIGH_RISK);
}
else
{
inTheMiddleR.setWarningStatus(Result.WARNING_STATUS_NO_RISK); // The default
// Are we in a period of high/long humidity?
if(Integer.valueOf(inTheMiddleR.getValue(SeptoriaHumidityModel.MODEL_ID.toString(), DataMatrix.HHS)) > this.thresholdHumidPeriodHours)
{
// are we after the last protected period (spraying applied + duration of protection)??
if(this.lastSprayingProtectionEnd == null || inTheMiddleR.getValidTimeStart().compareTo(this.lastSprayingProtectionEnd) >= 0)
{
inTheMiddleR.setWarningStatus(Result.WARNING_STATUS_HIGH_RISK);
humidPeriodStarted = Boolean.TRUE;
}
}
}
}
else
{
inTheMiddleR.setWarningStatus(Result.WARNING_STATUS_NO_WARNING);
}
}*/
retVal
.
add
(
r
);
currentDate
.
add1Hour
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment