Versions Compared

Key

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

EXTERNAL_FORECAST_TIME


What

nameofinstance.xml

Required

no

Description

Export data (timeseries) from Delft-Fews to several file formats

schema location

http

https://

fews

fewsdocs.

wldelft

deltares.nl/schemas/version1.0/timeSeriesExportRun.xsd

Entry in ModuleDescriptors

<moduleDescriptor id="TimeSeriesExportRun">
<description>Export module to export timeseries to various formats</description>
<className>nl.wldelft.fews.system.plugin.dataExport.TimeSeriesExport</className>

</moduleDescriptor>


Excerpt
hiddentrue

Exports data to several file formats

...

This elements describes how to construct the filename(s) of the exported file(s). Image Removed

Image Added

If only the name element is given a fixed name is used for each export. The prefix and suffix elements describe how to create a filename prefix and/or suffix. The temporaryPrefix is used to generate a prefix for the temporary file as it is being written. After that the file is renamed. Image Removed

validate

The option useExternalLocationIdAsName (instead of the regular file name) forces the use of the location ID or Name as filename. Note that this option does not work in combination with an idMap that filters the locations to be exported.


Image Added

validate

Optional element. Only applicable if the data are exported to the Optional element. Only applicable if the data are exported to the xml-file. This option activates the validation of the exported file against a XML schema.

...

Id of IdMap to be used for parameterId and locationId mapping

unitConversionsId

externalLocationNameFunction (since Delft-FEWS 2023.2)

For export functions that can write location names along side location ID's, one can choose the location attribute that should be parsed to the location name field. It requires mentioning the attribute between @ signs; e.g.: <externalLocationNameFunction>@externalLocationName@</externalLocationNameFunction>


unitConversionsId

Id of UnitConversions to be used for Id of UnitConversions to be used for unit mapping

flagConversionsId

...

If set to true records with missing values are not exported

exportLastValue

If set to true only the last value will be exported

precision

Available since 2018.02. Optional element to set the number of decimals all values should be displayed with. If set, additional zeros will be appended and/or values will be rounded when necessary. 

...

If configured all forecasts with a forecast time within the configured period will be exported. Since 2020.01  all forecasts will be exported to the same file.

When also configuring When also configuring a <timeZeroFormattingString> in the <prefix> of the <exportFileName>, each forecast will be exported to a separate file to easily differentiate between the different forecasts.When no <timeZeroFormattingString> is configured in the <exportFileName> all forecasts will be exported to the same file.

Note:  earlier versions  export  a separate file for each forecast by default.  The forecast time is used  to create a file extension (format yyyyMMddHH),  unless <timeZeroFormattingString>  is configured

Example configuration:

Code Block
languagexml
<export>
	<general>
		<exportType>SomeValidExportType</exportType>
		<folder>MyExportFolder</folder>
		<exportFileName>
			<name>_MyExportedFile.txt</name>
			<prefix>
				<timeZeroFormattingString>yyyyMMddHHmm</timeZeroFormattingString>
			</prefix>
		</exportFileName>
		<idMapId>MyIdMap</idMapId>
		<forecastSelectionPeriod start="-2" end="0" unit="day"/>
	</general>
	...
</export>

 


exportManualChanges

If used, only manual changed to the data will be exported. Unless the manualDBChangeViewPeriod is used, the relativeViewPeriod from the associated timeSeriesSet is used.
Image RemovedUnless the manualDBChangeViewPeriod is used, the relativeViewPeriod from the associated timeSeriesSet is used. Note:  the view period is calculated relative to the dispatch time and not T0
Image Added

exportChanges

If configured,  any  changes to the data in the configured period will be exported. Unless the dbChangeViewPeriod is configured, the relativeViewPeriod from the associated timeSeriesSet is used . Note:  the view period is calculated relative to the dispatch time and not T0

An example:

Code Block
<general>
    <exportType>PI</exportType>
    <folder>$EXPORT_FOLDER$</folder>    
    <exportFileName>
        <name>exportedTimeSeries.xml</name>
    </exportFileName>
    <exportChanges>
         <dbChangeViewPeriod unit="day" multiplier="2"/> 
    </exportChanges>
</general>



columnSeparator and decimalSeparator

...

With this property the deflate level for writing compressed netcdf files can be set from 0 to 9. 0 meaning no compression and 9 maximum compression. Default will be 5, this level gives best compression without losing too much time when reading or writing. 

metadata

...


(Meta data export has only been implemented for a limited set of export types. Currrently the NetCDF, grid2shp, LILA and HHRR types export meta data)

Optional metadata that is written in the exported file. The options netcdfMapDPhase and alertMapDPhase are deprecated (do not use these). For the other options it is possible to use the following tags:
%TIME_ZERO% the T0 of this time series export run.
%CURRENT_TIME% the current time._TIME% the current time.
%COLD_STATE_TIME% the cold state time.
%FORECAST_END_TIME% the forecast time set by the forecast length estimator or the forecast length option in the manual forecast dialog
%MODULE_INSTANCE_ID% the id of this module instance.
%MODULE_INSTANCE_NAME% the name of this module instance.
%MODULE_INSTANCE_DESCRIPTION% the configured description of this module instance.

%MODULE_INSTANCE_ATTRIBUTE(attributeId, moduleInstanceId)% moduleInstanceId is optional. When not specified the module instance of the module itself is used, like for the %MODULE_INSTANCE_ID% tag.
%WORKFLOW_ID% the id of the workflow in which this export runs.
%WORKFLOW_NAME% the name of the workflow in which this export runs.
%WORKFLOW_DESCRIPTION% the configured description of the workflow in which this export runs.

...

%COLD_STATE_TIME(yyyy/MM/dd HH:mm:ss z)% - the cold state start time. If data is unavailable it will be filled as "Unknown".


Since 2022.02 location/parameter/qualifier/moduleInstance attributes between @ are also recognized.

Configuration example of metadata:

Code Block
<metadata>
	<title>title</title>
	<institution>  institution  </institution>
	<source>source</source>
	<history>Exported at time zero = %TIME_ZERO(yyyy/MM/dd HH:mm:ss z)% in module instance %MODULE_INSTANCE_ID% as part of workflow %WORKFLOW_NAME% by user %USER_ID%.</history>
	<references>references</references>
	<comment>The actual time of writing was %CURRENT_TIME(yyyy-MM-dd HH:mm:ss z)%</comment>
	<summary>A summary of the data<data for @ATTRIBUTEID@</summary>
	<keyword>keyword1</keyword>
	<keyword>  keyword  with  lots  of  spaces  </keyword>
	<keyword>keyword 3</keyword>
	<customAttributes>
		<string key="emptyAttribute" value="    "/>
		<int key="  custom2  " value="123456"/>
		<string key="custom_3" value="This is a custom attribute with 'quotes' in it."/>
		<string key="    " value="attribute with empty key specified is not written"/>
		<float key="just_another_float" value="3.5"/>
		<bool key="truth" value="true"/>
	</customAttributes>
</metadata>

...