Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_APPLESCABM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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_APPLESCABM
Commits
38d92be5
Commit
38d92be5
authored
10 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Outsourced weather data validation (at least some of it)
parent
cddf0f2a
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/bioforsk/vips/model/applescabmodel/AppleScabModel.java
+5
-34
5 additions, 34 deletions
...no/bioforsk/vips/model/applescabmodel/AppleScabModel.java
with
5 additions
and
34 deletions
src/main/java/no/bioforsk/vips/model/applescabmodel/AppleScabModel.java
+
5
−
34
View file @
38d92be5
...
...
@@ -320,47 +320,18 @@ public class AppleScabModel extends I18nImpl implements Model{
}
}
// Basic time series health check
WeatherUtil
wUtil
=
new
WeatherUtil
();
// Must be of same length,
if
(
this
.
TM
.
size
()
!=
this
.
RR
.
size
()
||
this
.
TM
.
size
()
!=
BT
.
size
())
try
{
throw
new
ConfigValidationException
(
"Unequal length of weather parameter lists. "
+
"Temperature list size = "
+
this
.
TM
.
size
()
+
", precipitation list size = "
+
this
.
RR
.
size
()
+
", leaf wetness list size = "
+
this
.
BT
.
size
()
);
wUtil
.
isHomogenousTimeSeries
(
this
.
TM
,
this
.
RR
,
this
.
BT
);
}
// Must be starting at same time
if
(
this
.
TM
.
get
(
0
).
getTimeMeasured
().
compareTo
(
this
.
RR
.
get
(
0
).
getTimeMeasured
())
!=
0
||
this
.
TM
.
get
(
0
).
getTimeMeasured
().
compareTo
(
this
.
BT
.
get
(
0
).
getTimeMeasured
())
!=
0
)
catch
(
WeatherObservationListException
ex
)
{
throw
new
ConfigValidationException
(
"Weather parameter lists do not start at same time "
+
"Temperature list starts at = "
+
this
.
TM
.
get
(
0
).
getTimeMeasured
()
+
", precipitation list starts at = "
+
this
.
RR
.
get
(
0
).
getTimeMeasured
()
+
", leaf wetness list starts at = "
+
this
.
BT
.
get
(
0
).
getTimeMeasured
()
);
throw
new
ConfigValidationException
(
ex
.
getMessage
());
}
// Must be ending at same time
int
lastIndex
=
this
.
TM
.
size
()
-
1
;
if
(
this
.
TM
.
get
(
lastIndex
).
getTimeMeasured
().
compareTo
(
this
.
RR
.
get
(
lastIndex
).
getTimeMeasured
())
!=
0
||
this
.
TM
.
get
(
lastIndex
).
getTimeMeasured
().
compareTo
(
this
.
BT
.
get
(
lastIndex
).
getTimeMeasured
())
!=
0
)
{
throw
new
ConfigValidationException
(
"Weather parameter lists do not end at same time "
+
"Temperature list ends at = "
+
this
.
TM
.
get
(
lastIndex
).
getTimeMeasured
()
+
", precipitation list ends at = "
+
this
.
RR
.
get
(
lastIndex
).
getTimeMeasured
()
+
", leaf wetness list ends at = "
+
this
.
BT
.
get
(
lastIndex
).
getTimeMeasured
()
);
}
// If all that's OK, chop of all hour values exceeding the last full day
// of hourly data
this
.
TM
=
wUtil
.
cutTrailingHourlyValues
(
this
.
TM
,
timeZone
);
...
...
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