Overview

Imports time series data with observed hourly values from the KNMI that is delivered to the Dutch waterboards. The files are in a kind of CSV format with file extension (*.txt), where not a comma but a ";" is used as seperator. See for a detailed contents and definition of the file the KNMI site.

Notice that the parameters are not listed in the file. The parameters are hard coded in the import routines as defined at the KNMI site. Notice also that text fields like "cloudy" are not imported. Only parameters that contain values should be read, like rainfall (RhRhRh).

Configuration (Example)

A complete import module configuration consists of an ID Mapping file and a Import Module Instance file. To convert the rainfall in a proper unit (from 0.1 mm/hr to mm/hr for example) it is also required to configure a Unit Conversion file.

ModuleConfigFiles

The following example of an Import Module Instance will import the time series as equidistant series for timezone GMT with a time step of 6 hours.

ImportKNMI.xml
<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun ......">
  <import>
    <!--SYNOP (1h)-->
    <general>
      <importType>KNMISYNOPS</importType>
      <folder>$IMPORT_FOLDER_KNMI_SYNOPS$</folder>
      <failedFolder>$IMPORT_FAILED_FOLDER_KNMI_SYNOPS$</failedFolder>
      <backupFolder>$IMPORT_BACKUP_FOLDER_KNMI_SYNOPS$</backupFolder>
      <idMapId>IdImportSYNOPS</idMapId>
      <unitConversionsId>ImportKNMIUnits</unitConversionsId>
      <importTimeZone>
        <timeZoneOffset>+00:00</timeZoneOffset>
      </importTimeZone>
      <dataFeedId>KNMI-SYNOPS</dataFeedId>
    </general>
    <timeSeriesSet>
      <moduleInstanceId>ImportKNMI</moduleInstanceId>
      <valueType>scalar</valueType>
      <parameterId>P.meting</parameterId>
      <locationSetId>KNMI-SYNOPS</locationSetId>
      <timeSeriesType>external historical</timeSeriesType>
      <timeStep unit="hour" multiplier="1"/>
      <readWriteMode>add originals</readWriteMode>
      <synchLevel>1</synchLevel>
    </timeSeriesSet>
    <externUnit parameterId="P.meting" unit="0.1 mm/hr"/>
  </import>
</timeSeriesImportRun>

IdMapFiles

Defines mappings between KNMI and FEWS parameters and locations.

sample of IdImportEPS.xml
<idMap version="1.1"  ..............>
  <map internalParameter="P.meting" internalLocation="KNMI_370" externalParameter="RhRhRh" externalLocation="06370"/>
  <map internalParameter="P.meting" internalLocation="KNMI_479" externalParameter="RhRhRh" externalLocation="06479"/>
</idMap>

Important in this configuration is that the externalParameter are as defined at the KNMI site. They are not listed in the import files and therefore hard coded in the import routines.

UnitConversionFile

Defines the conversion of the units that should be applied.

sample of ImportKNMIUnits.xml
<?xml version="1.0" encoding="UTF-8"?>
<unitConversions ...................>
  <unitConversion>
    <inputUnitType>0.1 mm/hr</inputUnitType>
    <outputUnitType>mm/hr</outputUnitType>
    <multiplier>0.1</multiplier>
    <incrementer>0</incrementer>
  </unitConversion>  ........
  ........
</unitConversions>

Example file

Defines the conversion of the units that should be applied.

sample of 2007102503_decoded_synops_NL.txt
2007102503;06209;              ;     ;     ;  0 m.; ;               ; ;   ;   ;   ;
                ;     ;     ;     ;     ;     ;   ;     ;      ; ;  0.0;    ; ;   ;    ;
2007102503;06210;VALKENBURG;52.15; 4.42;  0 m.;5;cloudy;8;ENE;  3;  5;
             7.6;     ;     ;     ;     ;  5.1; 84;13000;1025.7; ;  0.0;    ; ;   ;  70;
2007102503;06225;IJMUIDEN;52.47; 4.57; 13 m.;6;; ;E;  6;  9;
                ;     ;     ;     ;     ;     ;   ;     ;      ; ;  0.0;    ; ;   ;  80;
2007102503;06229;TEXELHORS WP;53.00; 4.72;  1 m.;6;; ;ESE;  7; 10;
                ;     ;     ;     ;     ;     ;   ;     ;      ; ;  0.0;    ; ;   ; 110;
2007102503;06235;DE KOOY;52.93; 4.78;  0 m.;5;cloudy;8;E;  4;  9;
             8.5;     ;     ;     ;     ;  5.1; 79;30000;1026.8; ;  0.0;    ; ;   ; 100;
2007102503;06239;              ;     ;     ; 29 m.; ;               ; ;   ;   ;   ;
                ;     ;     ;     ;     ;     ;   ;     ;      ; ;  0.0;    ; ;   ;    ;
2007102503;06240;AMSTERDAM AP SCHIPHO;52.30; 4.77; -4 m.;5;cloudy;8;E;  3;  7;
             7.8;     ;     ;     ;     ;  5.3; 84;16000;1026.0; ;  0.0;    ; ;   ;  80; 

Example Files

See attached files

h3 Java source Code
KnmiSynopsTimeSeriesParser.java

  • No labels