Overview

The MinerveJson import function (<importType>MinerveJson</importType>) imports data from a folder with JSON files in the Minerve format. (since 2020.01).

Example JSON file

2020102313_FORECAST_CONTROL-C1E_ctrl_Stations_control.json
{
  "id": "c1c3ccad-cd25-4823-bafe-31fc5484cb2a",
  "key": "9f3573bc-2083-45b7-8fcc-f79169edc8ae",
  "last_computer": "MINERVE-P01",
  "last_user": "INFRA\\ladmjavflu",
  "name": "2020102313 FORECAST_CONTROL-C1E_ctrl Stations_control",
  "date_created": "2020-10-23T14:39:33.7265373+01:00",
  "reference": "2020-10-23T13:00:00",
  "date_last_saved": "2020-10-23T14:39:33.7421636+01:00",
  "timezone": "+00:00",
  "stations": [
    {
      "key": "3801208b-d9a2-43e7-90ad-68ca9ad39f5d",
      "name": "Rhone - Steg|Junction",
      "sensors": [
        {
          "key": "c67db349-adc7-4f5c-bd5c-182972ae2320",
          "type": "Inputs",
          "name": "QDown",
          "category": "Flow",
          "Unit": "CubicMetersPerSecond",
          "interpolation_mode": "Linear",
          "values": [
            {
              "event": "2020-10-23T13:00:00+00:00",
              "value": 45.2549858
            },
            {
              "event": "2020-10-23T14:00:00+00:00",
              "value": 49.9685822
            },
            {
              "event": "2020-10-24T15:00:00+00:00",
              "value": 46.0898762
            }
          ]
        }
      ],
      "x": 0.0,
      "y": 0.0,
      "z": 0.0
    }
  ]
}

Mapped json fields

From the filename

  • A filename can look as follows: 2020102313_FORECAST_CONTROL-C1E_ctrl_Stations_control.json. The external forecast time will be extracted based on the fileNameForecastCreationDateTimePattern that has to be configured in te general section of the import

From the json fields, the following parts will be mapped to FEWS:

  • timezone: will be used to determine date of the external forecast time
  • stations.name: locationId
  • stations.sensors.name: parameterId

  • stations.sensors.Unit: unit of the parameter.
  • stations.sensors.values.event: time of the event. timezone is expected to be part of the time
  • stations.sensors.values.value: value of the event.

Configuring the Import

De import type and folder with JSON files have to be configured in the Import Configuration. A basic example where one location and parameter are imported can be seen in the following XML configuration. Also take not that the external forecast time is determined by the date format of the file.

Import Configuration
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
	<import>
		<general>
			<importType>MinerveJson</importType>
			<folder>$IMPORT_FOLDER_ROOT$/Minerve</folder>
			<fileNameForecastCreationDateTimePattern>yyyyMMddHH'_FORECAST_CONTROL-C1E_ctrl_Stations_control.json'</fileNameForecastCreationDateTimePattern>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>Import_Minerve</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>QDown</parameterId>
			<locationId>Goneri - Oberwald OFEV|Junction</locationId>
			<timeSeriesType>external forecasting</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
		</import>
</timeSeriesImportRun>
  • No labels