Singapore OMS Lake Diagnostic System file format (Since 2010_01)

Files in the Singapore OMS Lake Diagnostic System file format are expected to be text files.

Implementation details

First, the location is determined from the first two characters of the filename. The import module will scan the input for the following lines:

  • SCHEDULE A
  • SCHEDULE B
  • Data Section

The parameters are collected from lines containing a slash '/', where the actual parameterId is taken from the left part before the slash. The parameters for SCHEDULE A are retrieved from the lines between SCHEDULE A and SCHEDULE B. The parameters for SCHEDULE B are retrieved from the lines between SCHEDULE B and Data Section. The actual data with measurements is retrieved from the lines after the Data Section tag. Each line with data that starts with 'A' or 'B' will contain also a number of space delimited values. The first value is the Julian day since 1-Jan-2000. The second value is the number of seconds in that day. The timestamp that is derived from this is supposed to be in same timezone as specified in the importTimeZone value of the import configuration. The other values are measurement data, for each parameter in the corresponding schedule. The import will determine the timestep from the difference in time between the first two data rows for each schedule. The other rows in a schedule must follow the same timestep for the schedule otherwise the import run will produce error messages. Also when either no data values for schedule A or B are found, a warning messages is produced.

Sample Input

The following sample shows equidistant timeseries data for schedule A with a timestep of 30 seconds and equidistant timeseries data for schedule B with a timestep of 15 minutes. The sample also shows the definition of two parameters TCHN 1 and TCHN 2 for schedule A and two parameters CHAN 8 for schedule B. The current implementation rounds the actual timestamps to make them acceptable as equidistant data for FEWS.

...
SCHEDULE A
TCHN 1 / ...
TCHN 2 / ...
...
SCHEDULE B
CHAN 8 /...
...
Data Section
A 3624 5490 28.694 28.704 28.702 28.656 28.850 28.782 28.906 28.861 28.732 28.984 135.025 0.280 17.529 0.042 0.220 0.673 0.150 0.871 0.209 
A 3624 5520 28.699 28.705 28.707 28.658 28.812 28.777 28.908 28.861 28.733 28.985 162.541 0.280 17.563 0.043 0.225 0.676 0.160 0.872 0.214 
...
A 3624 6300 28.664 28.699 28.684 28.654 28.810 28.817 28.827 28.831 28.679 28.987 166.052 0.280 19.242 0.074 0.310 0.978 0.216 1.357 0.303 
B 3624 6304 5.046 9.080 37.635 
A 3624 6330 28.655 28.695 28.682 28.654 28.789 28.806 28.837 28.828 28.676 28.988 145.881 0.280 19.242 0.073 0.308 1.007 0.205 1.290 0.302 
...
A 3624 7200 28.571 28.597 28.586 28.588 28.900 28.745 28.893 28.831 28.685 28.992 134.613 0.280 19.242 0.050 0.246 0.769 0.164 0.995 0.239 
B 3624 7204 3.178 6.103 225.012 
A 3624 7230 28.576 28.598 28.588 28.587 28.857 28.748 28.900 28.831 28.692 28.989 132.971 0.280 19.242 0.051 0.246 0.777 0.159 1.006 0.235 
...

Sample configuration file for importing Singapore OMS Lake Diagnostic System files

<?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>SingaporeLDS</importType>
			<folder>$IMPORT_FOLDER$/Lds</folder>
			<failedFolder>$IMPORT_FAILED_FOLDER$/Lds</failedFolder>
			<backupFolder>$IMPORT_BACKUP_FOLDER$/Lds</backupFolder>
			<idMapId>IdImportLds</idMapId>
			<importTimeZone>
				<timeZoneOffset>+08:00</timeZoneOffset>
			</importTimeZone>
		</general>
		<timeSeriesSet>
			<moduleInstanceId>ImportLds</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>T.obs.water</parameterId>
			<locationSetId>LDS_NTU-CWR</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="minute" multiplier="15"/>
			<readWriteMode>add originals</readWriteMode>
			<synchLevel>1</synchLevel>
			<expiryTime unit="day" multiplier="10"/>
		</timeSeriesSet>
	</import>
	
</timeSeriesImportRun>

Sample idMapping

When working with parameters with different depths the identifiers sometimes have to be mapped.
For instance suppose the parameterId in the input file was TCHN 1 and the location derived from the filename was t4, this case can easily be mapped to a internal identifiers MCH1 and T.obs.water using the following id mapping.

<?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">
	<map internalLocation="MCH1" internalParameter="T.obs.water" externalParameter="TCHN 1" externalLocation="t4"/>
...
</idMap>
  • No labels