Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_PSILARTEMP
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_PSILARTEMP
Commits
b5f0b688
Commit
b5f0b688
authored
5 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into 'develop'
Master See merge request VIPS/Model_PSILARTEMP!1
parents
98891f4b
67176949
No related branches found
No related tags found
1 merge request
!1
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/model/psilarosaetempmodel/PsilaRosaeTempModel.java
+10
-7
10 additions, 7 deletions
...o/vips/model/psilarosaetempmodel/PsilaRosaeTempModel.java
with
10 additions
and
7 deletions
src/main/java/no/nibio/vips/model/psilarosaetempmodel/PsilaRosaeTempModel.java
+
10
−
7
View file @
b5f0b688
...
...
@@ -19,8 +19,6 @@
package
no.nibio.vips.model.psilarosaetempmodel
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
java.io.IOException
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
...
...
@@ -223,8 +221,6 @@ public class PsilaRosaeTempModel extends I18nImpl implements Model {
// Init data matrix
this
.
dataMatrix
=
new
DataMatrix
();
ObjectMapper
mapper
=
new
ObjectMapper
();
// Setting timezone
this
.
timeZone
=
TimeZone
.
getTimeZone
((
String
)
config
.
getConfigParameter
(
"timeZone"
));
//System.out.println("TimeZone=" + this.timeZone);
...
...
@@ -232,9 +228,14 @@ public class PsilaRosaeTempModel extends I18nImpl implements Model {
// Importing weather data, creating collections
// Can accept both hourly and daily data
WeatherUtil
wUtil
=
new
WeatherUtil
();
List
<
WeatherObservation
>
observations
=
mapper
.
convertValue
(
config
.
getConfigParameter
(
"observations"
),
new
TypeReference
<
List
<
WeatherObservation
>>(){});
for
(
WeatherObservation
o:
observations
)
List
<
WeatherObservation
>
observations
=
modelUtil
.
extractWeatherObservationList
(
config
.
getConfigParameter
(
"observations"
));
if
(
observations
==
null
||
observations
.
isEmpty
())
{
throw
new
ConfigValidationException
(
"Please provide weather data."
);
}
for
(
WeatherObservation
o:
observations
)
{
switch
(
o
.
getElementMeasurementTypeId
())
{
case
WeatherElements
.
TEMPERATURE_MEAN
:
...
...
@@ -260,7 +261,9 @@ public class PsilaRosaeTempModel extends I18nImpl implements Model {
this
.
TM
,
this
.
timeZone
,
15
,
WeatherUtil
.
AGGREGATION_TYPE_AVERAGE
);
WeatherUtil
.
AGGREGATION_TYPE_AVERAGE
,
0
,
true
);
for
(
WeatherObservation
obs:
dailyTemperatures
)
{
this
.
dataMatrix
.
setParamValueForDate
(
obs
.
getTimeMeasured
(),
DataMatrix
.
TMD
,
obs
);
...
...
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