Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
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
VIPSLogic
Commits
4614f41a
Commit
4614f41a
authored
6 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix in wind data collection
parent
7e3c7f4b
No related branches found
No related tags found
2 merge requests
!17
Develop
,
!13
Spotit septoria map models
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/FinnCerealModelsPreprocessor.java
+25
-4
25 additions, 4 deletions
...ling/model/preprocessor/FinnCerealModelsPreprocessor.java
with
25 additions
and
4 deletions
src/main/java/no/nibio/vips/logic/scheduling/model/preprocessor/FinnCerealModelsPreprocessor.java
+
25
−
4
View file @
4614f41a
...
...
@@ -2,6 +2,7 @@ package no.nibio.vips.logic.scheduling.model.preprocessor;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -54,6 +55,7 @@ public class FinnCerealModelsPreprocessor extends ModelRunPreprocessor {
},
sowingDate
,
configuration
.
getDateEndInTimeZone
());
Collections
.
sort
(
observations
);
observations
=
wUtil
.
checkForAndFixHourlyTimeSeriesHoles
(
observations
);
List
<
WeatherObservation
>
temperature
=
observations
.
stream
().
filter
(
t
->
t
.
getElementMeasurementTypeId
().
equals
(
WeatherElements
.
TEMPERATURE_MEAN
))
.
collect
(
Collectors
.
toList
());
...
...
@@ -63,11 +65,30 @@ public class FinnCerealModelsPreprocessor extends ModelRunPreprocessor {
.
collect
(
Collectors
.
toList
());
List
<
WeatherObservation
>
windSpeedAll
=
observations
.
stream
().
filter
(
t
->
t
.
getElementMeasurementTypeId
().
equals
(
WeatherElements
.
WIND_SPEED_2M
))
.
collect
(
Collectors
.
toList
());
if
(
windSpeedAll
.
isEmpty
())
{
windSpeedAll
=
observations
.
stream
().
filter
(
t
->
t
.
getElementMeasurementTypeId
().
equals
(
WeatherElements
.
WIND_SPEED_10MIN_2M
))
.
collect
(
Collectors
.
toList
());
// Dealing with wind, which may be dodgy with regards to forecasts etc.
if
(
windSpeedAll
.
isEmpty
()
||
windSpeedAll
.
size
()
!=
temperature
.
size
())
{
List
<
WeatherObservation
>
windFallback
=
observations
.
stream
()
.
filter
(
t
->
t
.
getElementMeasurementTypeId
().
equals
(
WeatherElements
.
WIND_SPEED_10MIN_2M
))
.
collect
(
Collectors
.
toList
());
if
(
windSpeedAll
.
isEmpty
())
{
windSpeedAll
.
addAll
(
windFallback
);
}
else
{
Collections
.
sort
(
windSpeedAll
);
Date
lastWindTime
=
windSpeedAll
.
get
(
windSpeedAll
.
size
()-
1
).
getTimeMeasured
();
windSpeedAll
.
addAll
(
windFallback
.
stream
().
filter
(
o
->
o
.
getTimeMeasured
().
after
(
lastWindTime
)).
collect
(
Collectors
.
toList
()));
}
}
/*System.out.println("Observations size = " + observations.size());
/*
Collections.sort(temperature);
System.out.println("First temp is at " + temperature.get(0).getTimeMeasured());
System.out.println("Last temp is at " + temperature.get(temperature.size()-1).getTimeMeasured());
System.out.println("Observations size = " + observations.size());
System.out.println("temperature size=" + temperature.size());
System.out.println("rainfall size=" + rainfall.size());
System.out.println("rh size =" + rh.size());
...
...
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