Skip to content
Snippets Groups Projects

Fixing deserialization of Weather data

Merged Tor-Einar Skog requested to merge Aalto_spring2019 into develop
1 file
+ 6
5
Compare changes
  • Side-by-side
  • Inline
@@ -22,6 +22,7 @@ import no.nibio.vips.model.Model;
@@ -22,6 +22,7 @@ import no.nibio.vips.model.Model;
import no.nibio.vips.model.ModelExcecutionException;
import no.nibio.vips.model.ModelExcecutionException;
import no.nibio.vips.model.ModelId;
import no.nibio.vips.model.ModelId;
import no.nibio.vips.util.InvalidAggregationTypeException;
import no.nibio.vips.util.InvalidAggregationTypeException;
 
import no.nibio.vips.util.ModelUtil;
import no.nibio.vips.util.WeatherObservationListException;
import no.nibio.vips.util.WeatherObservationListException;
import no.nibio.vips.util.WeatherUtil;
import no.nibio.vips.util.WeatherUtil;
@@ -345,12 +346,12 @@ public class FinnCerealModels extends I18nImpl implements Model {
@@ -345,12 +346,12 @@ public class FinnCerealModels extends I18nImpl implements Model {
m.setTimeTillageEffects(b);
m.setTimeTillageEffects(b);
}
}
 
ModelUtil modelUtil = new ModelUtil();
// weather information
// weather information
ObjectMapper objectMapper = new ObjectMapper();
List<WeatherObservation> temperature = modelUtil.extractWeatherObservationList(arg0.getConfigParameter("temperature"));//objectMapper.convertValue(arg0.getConfigParameter("temperature"), new TypeReference<List<WeatherObservation>>(){});
List<WeatherObservation> 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> 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> 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>>(){});
List<WeatherObservation> windSpeedAll = objectMapper.convertValue(arg0.getConfigParameter("windspeed"), new TypeReference<List<WeatherObservation>>(){});
WeatherUtil wu = new WeatherUtil();
WeatherUtil wu = new WeatherUtil();
// get average daily temperatures
// get average daily temperatures
try {
try {
Loading