Skip to content
Snippets Groups Projects
Commit 3dc01128 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'Aalto_spring2019' into 'develop'

Fixing deserialization of Weather data

See merge request VIPS/Model_FINNCEREAL!5
parents 8b72c971 a421791e
1 merge request!5Fixing deserialization of Weather data
......@@ -22,6 +22,7 @@ import no.nibio.vips.model.Model;
import no.nibio.vips.model.ModelExcecutionException;
import no.nibio.vips.model.ModelId;
import no.nibio.vips.util.InvalidAggregationTypeException;
import no.nibio.vips.util.ModelUtil;
import no.nibio.vips.util.WeatherObservationListException;
import no.nibio.vips.util.WeatherUtil;
......@@ -345,12 +346,12 @@ public class FinnCerealModels extends I18nImpl implements Model {
m.setTimeTillageEffects(b);
}
ModelUtil modelUtil = new ModelUtil();
// weather information
ObjectMapper objectMapper = new ObjectMapper();
List<WeatherObservation> temperature = objectMapper.convertValue(arg0.getConfigParameter("temperature"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> rainfall = objectMapper.convertValue(arg0.getConfigParameter("rainfall"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> rh = objectMapper.convertValue(arg0.getConfigParameter("rh"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> windSpeedAll = objectMapper.convertValue(arg0.getConfigParameter("windspeed"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> temperature = modelUtil.extractWeatherObservationList(arg0.getConfigParameter("temperature"));//objectMapper.convertValue(arg0.getConfigParameter("temperature"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> rainfall = modelUtil.extractWeatherObservationList(arg0.getConfigParameter("rainfall"));//objectMapper.convertValue(arg0.getConfigParameter("rainfall"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> rh = modelUtil.extractWeatherObservationList(arg0.getConfigParameter("rh"));//objectMapper.convertValue(arg0.getConfigParameter("rh"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> windSpeedAll = modelUtil.extractWeatherObservationList(arg0.getConfigParameter("windspeed"));//objectMapper.convertValue(arg0.getConfigParameter("windspeed"), new TypeReference<List<WeatherObservation>>(){});
WeatherUtil wu = new WeatherUtil();
// get average daily temperatures
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment