Overview
The DHI_PRESA import function (<importType>DHI_PRESA</importType>) imports external historical time series from a specific CSV files for FEWS Basque. Since the csv data is specified in local time format, a timezone has to be configured in the importer:
<importTimeZone> <timeZoneName>CET</timeZoneName> </importTimeZone>
These files are received each 3-5 minutes. During one day they comprise all the intervals of the day, which means that each 3-5 minutes they are overwritten including all the intervals of the day till the time of sending.
Their name gives the date.
Time is local (i.e. +2 hr GMT in summer and +1hr GMT in winter)
Each line of the file represents one interval with several signals
There are 27 fields per line separated by “,” Values are given with decimal point.
- The first field contains the date and time. The following 26 fields contain the signal values.
- The first row contains the names of the signals. Each signal name contains a combination of parameters and locations. The following table shows the mapping of signal name to parameter id and location id. Signals where no parameter and location are specified, should be ignored.
Signal name | parameter id | location id |
---|---|---|
CONDU_E01A10C197QAL37 | QAL37 | E01A10 |
CONDU_E01A10C189QAL34 | QAL34 | E01A10 |
CONDU_E01A10C183QAL32 | QAL32 | E01A10 |
CONDU_E01A09D166NEMBA2 | NEMBA2 | E01A09 |
CONDU_E01A09C167PORCE | ||
CONDU_E01A09C166VEMBA | VEMBA | E01A09 |
CONDU_E01A09C162QAL24 | QAL24 | E01A09 |
CONDU_E01A09C156QAL22 | QAL22 | E01A09 |
CONDU_E01A05C68QALI3 | QALI3 | E01A05 |
CONDU_E01A05C64QAL12 | QAL12 | E01A05 |
CONDU_E01A05C60QALI1 | QALI1 | E01A05 |
CONDU_E01A01D7PLU | PLU | E01A01 |
CONDU_CAI_MB_QENT | QENT | CAI_MB |
CONDU_CAI_MB_QCAN | QCAN | CAI_MB |
CONDU_CAI_MB_PACT | ||
CONDU_APIL_AE_NIV | NIV | APIL_AE |
CONDU_AFOR_AI_QAFO | QAFO | AFOR_AI |
CONDU_AFOR_AE_QCAN | QCAN | AFOR_AE |
CONDU_AFOR_AE_NIVRR | NIVRR | AFOR_AE |
CONDU_AFOR_AE_NIVR | NIVR | AFOR_AE |
CONDU_AFOR_AE_NIVC | NIVC | AFOR_AE |
CONDU_AERE_AI_QA | QA | AERE_AI |
CONDU_AERE_AE_QC | QC | AERE_AE |
CONDU_AERE_AE_NIVC | NIVC | AERE_AE |
CONDU_AERE_AE_NAF2 | NAF2 | AERE_AE |
CONDU_AERE_AE_NAF1 | NAF1 | AERE_AE |
Configuring the Import
To make the importer known to FEWS, the import module has to be declared in the moduleInstanceDescriptors.xml in the RegionConfigFiles directory of the FEWS configuration:
<?xml version="1.0" encoding="UTF-8"?> <moduleInstanceDescriptors 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/moduleInstanceDescriptors.xsd" version="1.0"> ... <moduleInstanceDescriptor id="ImportDhiPresa"> <moduleId>TimeSeriesImportRun</moduleId> </moduleInstanceDescriptor> ... </moduleInstanceDescriptors>
An example of the DHI_PRESA import configuration will be given here. The importType is named DHI_PRESA which should be configured in the general section of the import.
Special attention should be given to the timezone since DHI_PRESA data is stored in local time;
<?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>DHI_PRESA</importType> <folder>$IMPORT_FOLDER$/import/dhi_presa</folder> <idMapId>dhiPresaMapId</idMapId> <importTimeZone> <timeZoneName>CET</timeZoneName> </importTimeZone> </general> <timeSeriesSet> <moduleInstanceId>ImportDhiPresa</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.m</parameterId> <locationId>FewsLocation</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="second" multiplier="1"/> <relativeViewPeriod unit="minute" start="0" end="10"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </import> </timeSeriesImportRun>
The IdMapping configuration dhiPresMapId.xml is very important because this maps the internal FEWS Id's to the DHI_PRESA Id's. An example IdMapping file for the DHI_PRESA importer is shown below.:
<?xml version="1.0" encoding="UTF-8"?> <idMap version="1.1" 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/idMap.xsd"> .... <parameter internal="Q.m" external="NEMBA2"/> <location internal="FewsLocation" external="E01A09"/> .... </idMap>
Example DHI_PRESA file
Date_and_Time,CONDU_E01A10C197QAL37,CONDU_E01A10C189QAL34,CONDU_E01A10C183QAL32,CONDU_E01A09D166NEMBA2,CONDU_E01A09C167PORCE,CONDU_E01A09C166VEMBA,CONDU_E01A09C162QAL24,CONDU_E01A09C156QAL22,CONDU_E01A05C68QALI3,CONDU_E01A05C64QAL12,CONDU_E01A05C60QALI1,CONDU_E01A01D7PLU,CONDU_CAI_MB_QENT,CONDU_CAI_MB_QCAN,CONDU_CAI_MB_PACT,CONDU_APIL_AE_NIV,CONDU_AFOR_AI_QAFO,CONDU_AFOR_AE_QCAN,CONDU_AFOR_AE_NIVRR,CONDU_AFOR_AE_NIVR,CONDU_AFOR_AE_NIVC,CONDU_AERE_AI_QA,CONDU_AERE_AE_QC,CONDU_AERE_AE_NIVC,CONDU_AERE_AE_NAF2,CONDU_AERE_AE_NAF1 2014-05-05 00:00:48,0.000000,0.000000,0.000000,153.480000,89.978073,33.543484,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1796.000000,845.000000,821.000000,0.000000,0.000000,1422.000000,0.434000,0.449000,0.966000,6.711419,6.119000,1.530000,0.542000,0.510000 2014-05-05 00:04:19,0.000000,0.000000,0.000000,153.480000,89.978073,33.543484,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1789.000000,849.000000,831.000000,0.000000,1.770736,1431.000000,0.440000,0.453000,0.964000,6.448431,5.892000,1.530000,0.542000,0.500000