Introduction
Export scalar timeseries to PI type format (example config). This xml format is described in detail in the Delft-Fews published interface documentation.
Example
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <timeZone>0.0</timeZone> <series> <header> <type>accumulative</type> <locationId>EA_H-2001</locationId> <parameterId>Rainfall</parameterId> <timeStep unit="second" multiplier="900"/> <startDate date="2003-03-01" time="00:00:00"/> <endDate date="2003-03-01" time="05:00:00"/> <missVal>-999.0</missVal> <stationName>Bewdley</stationName> <units>m</units> </header> <event date="2003-03-01" time="00:00:00" value="-999.0" flag="88"/> <event date="2003-03-01" time="00:15:00" value="0.0010" flag="44"/> <event date="2003-03-01" time="00:30:00" value="0.0020" flag="44"/> <event date="2003-03-01" time="00:45:00" value="0.0030" flag="44"/> <event date="2003-03-01" time="01:00:00" value="0.0040" flag="44"/> <event date="2003-03-01" time="01:15:00" value="-999.0" flag="88"/> <event date="2003-03-01" time="01:30:00" value="0.0060" flag="44"/> <event date="2003-03-01" time="01:45:00" value="0.0070" flag="44"/> <event date="2003-03-01" time="02:00:00" value="0.0080" flag="44"/> <event date="2003-03-01" time="02:15:00" value="0.009000001" flag="44"/> <event date="2003-03-01" time="02:30:00" value="0.010000001" flag="44"/> <event date="2003-03-01" time="02:45:00" value="0.011000001" flag="44"/> <event date="2003-03-01" time="03:00:00" value="0.012" flag="44"/> <event date="2003-03-01" time="03:15:00" value="0.013" flag="44"/> <event date="2003-03-01" time="03:30:00" value="0.014" flag="44"/> <event date="2003-03-01" time="03:45:00" value="0.015000001" flag="44"/> <event date="2003-03-01" time="04:00:00" value="0.016" flag="44"/> <event date="2003-03-01" time="04:15:00" value="0.017" flag="44"/> <event date="2003-03-01" time="04:30:00" value="0.018000001" flag="44"/> <event date="2003-03-01" time="04:45:00" value="0.019000001" flag="44"/> <event date="2003-03-01" time="05:00:00" value="0.020000001" flag="44"/> </series> </TimeSeries>
To support the validation status, it is possible since PI timeseries version 1.19 to define flagSourceColumns and (custom)flagSources in the PI-XML timeseries format. For example a flag source column named 'V3' that has a custom flag source value 'OK' will result in an attribute
fs:V3="OK"
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.19" xmlns:fs="http://www.wldelft.nl/fews/fs"> <timeZone>1.0</timeZone> <series> <header> <type>instantaneous</type> <moduleInstanceId>WerkFilter</moduleInstanceId> <locationId>140-w_Leidsche Rijn</locationId> <parameterId>HGTE_METING_15M</parameterId> <timeStep unit="second" multiplier="900"/> <startDate date="2012-06-25" time="17:45:00"/> <endDate date="2012-06-25" time="21:45:00"/> <missVal>NaN</missVal> <stationName>AANVOERDER_140-w_Leidsche Rijn</stationName> <lat>52.082416488309036</lat> <lon>5.075337740730613</lon> <x>133623.0</x> <y>454951.0</y> <z>-9999.0</z> <units>mNAP</units> </header> <event date="2012-06-25" time="19:30:00" value="-0.414" flag="0" fs:V3="OK" fs:V4="OK"/> <event date="2012-06-25" time="21:45:00" value="-0.385" flag="0" fs:V2="OK" fs:V3="OK"/> </series> </TimeSeries>
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.23" xmlns:fs="http://www.wldelft.nl/fews/fs"> <timeZone>0.0</timeZone> <series> <header> <type>instantaneous</type> <moduleInstanceId>moduleInstanceId</moduleInstanceId> <locationId>loc</locationId> <parameterId>par</parameterId> <qualifierId>A</qualifierId> <qualifierId>B</qualifierId> <timeStep unit="nonequidistant"/> <startDate date="1000-01-01" time="00:00:00"/> <endDate date="1000-01-01" time="00:00:00"/> <forecastDate date="2000-01-01" time="00:00:00"/> <missVal>NaN</missVal> <longName>a long name</longName> <lat>1.0</lat> <lon>2.0</lon> <x>2.0</x> <y>1.0</y> <z>3.0</z> <units>m</units> <sourceOrganisation>a source organisation</sourceOrganisation> <sourceSystem>a source system</sourceSystem> <fileDescription>a description</fileDescription> <creationDate>2100-01-01</creationDate> <creationTime>00:00:00</creationTime> </header> <properties> <string key="organisation" value="Deltares"/> <dateTime key="request time" date="2000-01-01" time="12:00:00"/> </properties> <event date="1000-01-01" time="00:00:00" startDate="0999-12-31" endDate="1000-01-02" value="4.0" minValue="3.5" maxValue="5.5"/> </series> </TimeSeries>
Since PI version 1.24, it is possible to add minutes attribute to time steps, as well as attributes to locations. It is also possible to add qualifiers. Below is an example which shows how to add a minutes attribute to time steps:
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.24" xmlns:fs="http://www.wldelft.nl/fews/fs"> <timeZone>0.0</timeZone> <series> <header> <type>instantaneous</type> <locationId>loc</locationId> <parameterId>par</parameterId> <timeStep minutes="15 50"/> <startDate date="2018-02-12" time="09:15:00"/> <endDate date="2018-02-12" time="10:50:00"/> <missVal>NaN</missVal> <units>m</units> </header> <event date="2018-02-12" time="09:15:00" value="0.186" flag="2"/> <event date="2018-02-12" time="09:50:00" value="0.183" flag="2"/> </series> </TimeSeries>
PI version 1.25 does not contain any changes relevant to export.
Since PI version 1.26, it is possible to add product to header. Below is an example which shows how this can be done:
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.26" xmlns:fs="http://www.wldelft.nl/fews/fs"> <timeZone>0.0</timeZone> <series> <header> <type>instantaneous</type> <moduleInstanceId>Forecast</moduleInstanceId> <locationId>amerongen_beneden</locationId> <parameterId>H.voorspeld.daily</parameterId> <timeStep unit="second" multiplier="86400"/> <startDate date="2012-12-31" time="00:00:00"/> <endDate date="2013-01-05" time="00:00:00"/> <forecastDate date="2013-07-09" time="17:05:00"/> <missVal>-999.0</missVal> <stationName>amerongen beneden</stationName> <lat>51.98</lat> <lon>5.4</lon> <x>5.4</x> <y>51.98</y> <z>0.0</z> <units>m</units> <firstValueTime date="2013-01-01" time="00:00:00"/> <lastValueTime date="2013-01-04" time="00:00:00"/> <maxValue>4</maxValue> <minValue>1</minValue> <valueCount>4</valueCount> <product id="ANiceProduct" name="ANiceProduct"> <productDate date="2019-06-25" time="11:31:59"/> <category id="Meteo" name="Meteo"/> <productInfo> <user>Erik Pelgrim</user> <confidence>MEDIUM</confidence> <classification>INTERNAL</classification> <comment>Awww</comment> </productInfo> <productInfo> <user>Anne Hommelberg</user> <confidence>MEDIUM</confidence> <classification>CONFIDENTIAL</classification> <comment>It is a very nice product!</comment> </productInfo> <productInfo> <user>Onno van den Akker</user> <confidence>LOW</confidence> <classification>PUBLIC</classification> <comment>Theoretically impossible!</comment> </productInfo> <productInfo> <user>Erik Pelgrim</user> <confidence>MEDIUM</confidence> <classification>INTERNAL</classification> <comment>Awww</comment> </productInfo> </product> </header> <event date="2012-12-31" time="00:00:00" value="-999.0" flag="8"/> <event date="2013-01-01" time="00:00:00" value="3" flag="0"/> <event date="2013-01-02" time="00:00:00" value="1" flag="0"/> <event date="2013-01-03" time="00:00:00" value="4" flag="0"/> <event date="2013-01-04" time="00:00:00" value="1" flag="0"/> <event date="2013-01-05" time="00:00:00" value="-999.0" flag="8"/> </series> </TimeSeries>
Since PI version 1.27, it is possible to add threshold label, description and comments to time steps. Below is an example which shows how this can be done:
<?xml version="1.0" encoding="UTF-8"?> <TimeSeries xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd" version="1.26" xmlns:fs="http://www.wldelft.nl/fews/fs"> <timeZone>0.0</timeZone> <series> <header> <type>instantaneous</type> <locationId>loc</locationId> <parameterId>par</parameterId> <timeStep unit="second" multiplier="3600"/> <startDate date="2014-10-19" time="00:00:00"/> <endDate date="2014-10-19" time="03:00:00"/> <missVal>NaN</missVal> <units>m</units> <thresholds> <highLevelThreshold id="FaseA" name="Fase A: Verhoogde waakzaamheid" label="label for threshold" description="description" comment="comment" value="1.15" groupId="Alarm" groupName="Alarm"></highLevelThreshold> </thresholds> </header> <event date="2014-10-19" time="00:00:00" value="0.186" flag="2"/> <event date="2014-10-19" time="01:00:00" value="0.183" flag="2"/> </series> </TimeSeries>