Skip to content
Snippets Groups Projects
VIPS Logo

VIPS Model input data

Tor-Einar Skog, Senior developer, NIBIO

Updated: 2023-02-23

Below is a minimum example of VIPS result data.

---> TODO create Json schema <---

{
	modelId:'REFERENCEM',
	configParameters: {
		'sowingDate': '2022-03-01', 
		'observations': [
			{'timeMeasured': '2015-03-01T00:00:00+01:00', 'elementMeasurementTypeId': 'TM', 'logIntervalId': '2', 'value': '1.41025'}, 
			{'timeMeasured': '2015-03-02T00:00:00+01:00', 'elementMeasurementTypeId': 'TM', 'logIntervalId': '2', 'value': '2.87608333333333'}, 
			{'timeMeasured': '2015-03-03T00:00:00+01:00', 'elementMeasurementTypeId': 'TM', 'logIntervalId': '2', 'value': '1.00854166666667'}, 
			{'timeMeasured': '2015-03-04T00:00:00+01:00', 'elementMeasurementTypeId': 'TM', 'logIntervalId': '2', 'value': '-1.44675'}
		]
	}
}

modelId

This is the 10-character unique id for the specific model

configParameters

Here are the input data, which are free-form. The first one is the sowingDate that this specific model requires.

Weather data

By convention weather data are to be found in the observations property, and they must follow the VIPS weather data format. With observations, we actually mean all weather data that the model uses; past, present and future. A typical model expects all weather data to be in one continuous list of observations combining measured data and forecasts.

PestObservation: Observations/registrations of pests and diseases in the field

The weather observations follow a standard pattern, and so do the field observations:

{
	"pestObservations": [{
		"timeOfObservation": 1461103200000,
		"observationData": "{\"trapCountCropEdge\":3,\"trapCountCropInside\":0}",
		"name": "Lorem Ipsum",
		"geoinfo": {
			"type": "FeatureCollection",
			"features": [
				{
				"type": "Feature",
				"properties": {},
				"geometry": {
					"coordinates": [
					10.44766117815368,
					59.22486514003208
					],
					"type": "Point"
				}
				}
			]
			}
	}, {
		"timeOfObservation": 1461448800000,
		"observationData": "{\"trapCountCropEdge\":1,\"trapCountCropInside\":5}",
		"name": "Lorem Ipsum",
		"geoinfo": {
			"type": "FeatureCollection",
			"features": [
				{
				"type": "Feature",
				"properties": {},
				"geometry": {
					"coordinates": [
					10.44766117815368,
					59.22486514003208
					],
					"type": "Point"
				}
				}
			]
			}
	}],
}

The properties are:

  • timeOfObservation - timestamp when the obervation was made [REQUIRED]
  • geoinfo: GeoJson describing the location. May or may not be required by the model
  • name: Title of the observation (not important in models)
  • observationData: Json formatted data quantifying the observation. The properties vary greatly between the pests. For each pest observation based models, there is a Json schema for this.

Pest observations may be only one or a series, depending on the model. If no observations available, the model should handle NULL.

Usage in a VIPS model

Java

In VIPSCommon, there is a ModelConfiguration class that encapsulates all the necessary functionality.

Python

In VIPSCore-Python-Common there is a ModelConfiguration class in entities.py that encapsulates all the necessary functionality.