Page tree
Skip to end of metadata
Go to start of metadata

Overview

Imports Swiss Hydro Data time series data as ASCII files that are delivered to FOEN in Switzerland. The files contain discharge time series in m3/s and water levels in cm. The files have a name that contains the delivery date ("hbchaFEWS.2016041223.txt"), this information is not used when importing the files..

Configuration (Example)

A complete import module configuration consists of an ID Mapping file and an Import Module Instance file. Examples of the two are provided below.

The SHD file has the following characteristics:

  • Header lines start with a %
  • A new data section (time series) in the file starts with %ASCI or ASCII
  • The second header line contains the location ID, parameter ID and qualifier ID.
    In the old header formatting (using <importType> "SHD"): the header %GL-04140875-10-0 is split by the '-' character, so first part %GL is ignored, the second part is used as location ID, the third as the parameter ID and the forth as the qualifier ID (if present).
    In the new header formatting (using <importType> "shd-extloc", available since 2017.01): the header %GL-04140875-10-0 the starting % is removed, then the header is split by the '-' character, the first and second part are used as location ID (separated by '-', "GL-04140875" for the example), the third as the parameter ID and the forth as the qualifier ID.
  • The third header line contains the unit. The header %Schwanden Sernf - Abfluss - m3/s is split by the '-' character, only last part is used (m3/s)
  • All rows that does not start with % are data lines
  • Missing value identifier is expected to be: blank
    • First column contains data with format "dd.MM.yyyy"
    • Second column contains time with format ""HH:mm:ss" or ""HH:mm"
    • Third column contains value with decimal point.

ModuleConfigFiles/

The following example of an Import Module Instance will import the time series as equidistant 1 hour interval series for time zone GMT+1 hour.

Import_SHD.xml
<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>shd-extloc</importType>      <!-- use importType "SHD" for the old location id formatting -->
			<folder>$IMPORT_FOLDER_ROOT$//hbcha</folder>
			<failedFolder>$FAILED_FOLDER_ROOT$</failedFolder>
			<idMapId>ImportSwiss</idMapId>
			<unitConversionsId>ImportHydroUnits</unitConversionsId>
			<missingValue>-999</missingValue>
			<importTimeZone>
				<timeZoneOffset>+01:00</timeZoneOffset>
			</importTimeZone>
			<dataFeedId>Import.HBCHA</dataFeedId>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>Observed</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.m</parameterId>
			<locationSetId>HydroStations_ALL</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>Observed</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.m</parameterId>
			<locationSetId>HydroStations_ALL</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>

IdMapFiles/

The ID mapping file will contain a mapping of the parameters and locations in the data file with the internal parameter and location ID’s of the Delft-FEWS application.

sample of IdMapSHD.xml
<idMap 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" version="1.1">
	<!--mapped Observed water level data series-->
	<parameter external="2" internal="H.m"/>
	<parameter external="10" internal="Q.m"/>
	<locationIdFunction externalLocationFunction="@EXTERNAL_ID@" internalLocationSet="HydroStations_ImportSwiss"></locationIdFunction>
</idMap>

Example File/

hbchaFEWS.2016041223.txt
%ASCII-Tabelle/von HydroPro; ©HBCHa 2016
%HBBEa-A013-10-10
%Zweisimmen - Abfluss - m3/s
11.04.2016	01:00	6.589
11.04.2016	02:00	6.610
11.04.2016	03:00	6.494
11.04.2016	04:00	6.411
11.04.2016	05:00	6.395
11.04.2016	06:00	6.291
11.04.2016	07:00	6.254
11.04.2016	08:00	
11.04.2016	09:00	6.116
11.04.2016	10:00	6.145
........

Java source code

Delft-FEWS Java import parser source code: ShdTimeSeriesParser.java

  • No labels