Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents

Table of Contents

Summary


This document contains a step by step guide how to import data in PI XML format into Delft-Fews.

Info

Note: This document does NOT describe all the possible options of the Import module; this information can be found

...

on this wiki page 03 Import Module.


Importing data in DELFT-FEWS is different from running a wizard in e.g. a much used office software package. To be able to import data a number of xml configuration files needs to be adjusted or created. In short, this entails the following steps:

...

  1. The file-type you want to import should be readable by one of the imports available in Delft-Fews
  2. You must configure an instance of this import module
  3. You must add the moduleInstance to a workflow (usually the ImportExternal Workflow)
  4. In case the locationId's and parameterId's in your Delft-Fews configuration are not identical to those in the files you need to import a IdMap file should be set up and referred to in the import module
  5. You will probably need to adjust one or more locationsets, the filters.xml file and the DisplayGroups.xml file if you need to display or process the newly imported data.

    Info

    Please note that Delft-Fews DELETES all files after importing them. As such, you should ALWAYS copy files from another directory to the location from which Delft-Fews imports files. If you do not do this you might loose you files.


...

The timeSeriesSet element defines how the data will be stored in Delft-Fews. If you later want to view, use or export the data you will need the same timeseriesset to retrieve or view the data. In the timeseriesset we have defined the following:


  • moduleInstanceId - Name of this configuration instance, reflects the XML file name
  • valueType - scalar, this is scalar data
  • parameterId - H.obs - This is the parameterId in Delft-Fews. The parameter Id in the XML file is WaterLevel. The Id mapping (shown below) will map Waterlevel to H.obs
  • locationSetId - In order to simplify configuration we have defined a list of locations (a locationset) in the file LocationSets.xml (in the RegionConfigFiles directory). This set holds the following four locations: one, two, three, fours. As these are different from the locations in the XML file to be imported id mapping will be set up.
  • timeStep - the timestep defined here should map the timestep in the XML files to be imported.


Step 2: Register the new module - Add to the ModuleInstanceDescriptors 1.00 default.xml file


All moduleInstances must be registered in Delft-Fews. This is done by adding en entry in the moduleInstanceDescriptors file in the RegionConfigFiles section of the configuration. The moduleInstancedescriptors file shown below includes this appropriate entry:

...

Tip

In this example only one moduleInstance is present. Usually you will need to ad add your module to an existing list.

...

Code Block
XML
XML
<?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">
	<!--Import Module Instances-->
	<moduleInstanceDescriptor id="Import">
		<description>Import Our new data</description>
		<moduleId>TimeSeriesImportRun</moduleId>
	</moduleInstanceDescriptor>
</moduleInstanceDescriptors>


Step 3: Add the module to a workflow (ImportExternal 1.00 Default.xml)


In order to use the module (to be able to run it from the manual forecast dialog) you will need to list the module as an activity in a workflow. Assuming this workflow is already registered (see the Delft-Fews configuration manual on how to register workflow) the only thing to do is to add in to the workflow. In the following example the new module is the only activity in the workflow:

...

Code Block
XML
XML
<?xml version="1.0" encoding="UTF-8"?>
<workflow 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/workflow.xsd]" version="1.1">
	<activity>
		<runIndependent>true</runIndependent>
		<moduleInstanceId>Import</moduleInstanceId>
	</activity>
</workflow>
{code:XML}

h2. Step 


Step 4:

...

Make the locationSet 


In order to refer to all four locations in one go (Instead of having to create four different timeseriesset) a locationset is defined in the file LocationSets 1.00 Default.xml in the RegionConfigFiles directory:


Code Block
XML
XML
 the locationSet&nbsp;

In order to refer to all four locations in one go (Instead of having to create four different timeseriesset) a locationset is defined in the file [LocationSets 1.00 Default.xml|^LocationSets 1.00 default.xml] in the RegionConfigFiles directory:
{code:XML}
<?xml version="1.0" encoding="UTF-8"?>
<locationSets 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/locationSets.xsd]">
	<locationSet id="LevelGauges" name="LevelGauges">
		<locationId>one</locationId>
		<locationId>two</locationId>
		<locationId>three</locationId>
		<locationId>four</locationId>
	</locationSet>

</locationSets>


Set up Id Mapping

...

Code Block
XML
XML
<?xml version="1.0" encoding="UTF-8"?>
<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">
	<parameter internal="H.obs" external="WaterLevel"/>
	<location internal="one" external="LocA"/>
	<location internal="two" external="LocB"/>
	<location internal="three" external="LocC"/>
	<location internal="four" external="LocD"/>
</idMap>

Step 6: register the idmap file

Similar to ModuleInstances, IdMaps should also be registered. In this case we need to register the IdImport file in the file IdMapDescriptors in the RegionConfigFiles directory:

Code Block
XMLXML

<?xml version="1.0" encoding="UTF-8"?>
<idMapDescriptors 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/idMapDescriptors.xsd" version="1.0">
	<idMapDescriptor id="IdImport"/>
</idMapDescriptors>


Setting up a (temporary) display to view the imported data

...