Wave project file: Difference between revisions

From BlueM
Jump to navigation Jump to search
(update for v2.6.0)
(switch to formatted source)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
<div style="float:right; margin:0 0 1em 1em">__TOC__</div>
<div style="float:right; margin:0 0 1em 1em">__TOC__</div>


A '''Wave project file''' (<code>*.wvp</code>) is a text file that can be used to quickly load multiple series from multiple files at once.
A '''Wave project file''' (<code>*.wvp</code>) is a text file that can be used to quickly load multiple series from multiple files at once. You can create/edit a project file using a text editor or save a project file from within Wave ([[File:Icon_disk.png|link=]] Save &rarr; [[File:Icon_chart_curve_link.png|link=]] Save project file).


The basic format is as follows:
The basic format is as follows:
<pre>
<source lang="wvp">
file=<path\to\file>
file=<path\to\file>
  series=<series name>
  series=<series name>
Line 13: Line 13:
  series=<series name>
  series=<series name>
  series=<series name>
  series=<series name>
</pre>
</source>


The <code>file</code> keyword specifies the path to the time series file to import from. The path can be absolute or relative (to the project file). You can specify multiple files.
The <code>file</code> keyword specifies the path to the time series file to import from. The path can be absolute or relative (to the project file). You can specify multiple files.
Line 20: Line 20:


'''Note:''' If the series name contains a colon (<code>:</code>), the name has to be enclosed in quotes, e.g.:
'''Note:''' If the series name contains a colon (<code>:</code>), the name has to be enclosed in quotes, e.g.:
<pre>
<source lang="wvp">
  series="series:name"
  series="series:name"
</pre>
</source>


==Custom titles==
==Custom titles==
It is possible to specify custom titles by writing the custom title after a colon (<code>:</code>) behind the series name:
It is possible to specify custom titles by writing the custom title after a colon (<code>:</code>) behind the series name:
<pre>
<source lang="wvp">
  series=<series name>:my custom title
  series=<series name>:my custom title
</pre>
</source>


'''Note:''' If the custom title contains an equal sign (<code>=</code>) or a comma (<code>,</code>), it must be enclosed in quotes, e.g.:
'''Note:''' If the custom title contains an equal sign (<code>=</code>) or a comma (<code>,</code>), it must be enclosed in quotes, e.g.:
<pre>
<source lang="wvp">
  series=<series name>:"my , very = custom title"
  series=<series name>:"my , very = custom title"
</pre>
</source>


==Series options==
==Series options==
Additional series options can be specified as a list of comma-separated keyword arguments after a colon (<code>:</code>) behind the series name:
Additional series options can be specified as a list of comma-separated keyword arguments after a colon (<code>:</code>) behind the series name:
<pre>
<source lang="wvp">
  series=<series name>:<keyword>=<value>, <keyword>=<value>, ...
  series=<series name>:<keyword>=<value>, <keyword>=<value>, ...
</pre>
</source>
'''Note:''' When using keyword options, any custom title must also be specified using the appropriate <code>title</code> keyword.
'''Note:''' When using keyword options, any custom title must also be specified using the appropriate <code>title</code> keyword.


Line 68: Line 68:
==Example==
==Example==
This is a [https://github.com/bluemodel/BlueM.Datasets/blob/master/Wave/WVP/wvp_example.wvp basic example] that loads multiple series from multiple different files of different types:
This is a [https://github.com/bluemodel/BlueM.Datasets/blob/master/Wave/WVP/wvp_example.wvp basic example] that loads multiple series from multiple different files of different types:
<pre>
<source lang="wvp">
# Import multiple series from multiple files
# Import multiple series from multiple files
#-------------------------------------------
#-------------------------------------------
Line 78: Line 78:
file=..\BIN\abfluss_1.bin
file=..\BIN\abfluss_1.bin
  series=abfluss_1.bin: title="Discharge", unit="m3/s", interpretation=Instantaneous, color=Red, linewidth=4, linestyle=Dash, showPoints=True
  series=abfluss_1.bin: title="Discharge", unit="m3/s", interpretation=Instantaneous, color=Red, linewidth=4, linestyle=Dash, showPoints=True
</pre>
</source>


==Custom file import settings==
==Custom file import settings==
Line 84: Line 84:


Example with all possible settings:
Example with all possible settings:
<pre>
<source lang="wvp">
file=myrandom.csv
file=myrandom.csv
  # custom import settings
  # custom import settings
Line 100: Line 100:
  series=myseries1
  series=myseries1
  series=myseries2
  series=myseries2
</pre>
</source>


The accepted import settings are described below:
The accepted import settings are described below:

Latest revision as of 06:09, 11 November 2023

Wave.png Wave | Download | Development

A Wave project file (*.wvp) is a text file that can be used to quickly load multiple series from multiple files at once. You can create/edit a project file using a text editor or save a project file from within Wave (Icon disk.png Save → Icon chart curve link.png Save project file).

The basic format is as follows:

file=<path\to\file>
 series=<series name>
 series=<series name>
file=<path\to\file>
 series=<series name>
 series=<series name>

The file keyword specifies the path to the time series file to import from. The path can be absolute or relative (to the project file). You can specify multiple files.

The series keyword specifies the name of the series to import from the file specified above it. You can specify multiple series per file. If none are specified, all series contained in the file are imported.

Note: If the series name contains a colon (:), the name has to be enclosed in quotes, e.g.:

 series="series:name"

Custom titles

It is possible to specify custom titles by writing the custom title after a colon (:) behind the series name:

 series=<series name>:my custom title

Note: If the custom title contains an equal sign (=) or a comma (,), it must be enclosed in quotes, e.g.:

 series=<series name>:"my , very = custom title"

Series options

Additional series options can be specified as a list of comma-separated keyword arguments after a colon (:) behind the series name:

 series=<series name>:<keyword>=<value>, <keyword>=<value>, ...

Note: When using keyword options, any custom title must also be specified using the appropriate title keyword.

The following keywords are supported:

  • title: assigns a custom title
  • unit: assigns the specified unit
  • interpretation: assigns the specified interpretation, must be the name of one of the members of BlueM.Wave.TimeSeries.InterpretationEnum, possible values:
    • Instantaneous
    • BlockRight
    • BlockLeft
    • Cumulative
    • CumulativePerTimestep
    • Undefined
  • color: assigns the specified color, can be the name of one of the members of System.Drawing.KnownColor (e.g. Red) or a hexadecimal representation of ARGB values (e.g. ffff0000)
  • linewidth: assigns the specified line width (default is 2)
  • linestyle: assigns the specified line style, must be the name of one of the members of System.Drawing.Drawing2D.DashStyle, possible values:
    • Solid (default)
    • Dash
    • Dot
    • DashDot
    • DashDotDot
  • showpoints: whether to display series points, must be True or False, default is False

Notes:

  • Keywords can be specified in any order and are not case-sensitive
  • Values are case-sensitive and must be enclosed in quotes if they contain an equal sign (=) or a comma (,)

Example

This is a basic example that loads multiple series from multiple different files of different types:

# Import multiple series from multiple files
#-------------------------------------------
file=..\UVF\42960.0_q_28.uvf
file=..\WEL\DEMONA_PSI.wel
 series=S3  _1AB: S3 outflow
 series=S3  _1ZU: S3 inflow
file=..\ZRE\Zufl_gem.zre
file=..\BIN\abfluss_1.bin
 series=abfluss_1.bin: title="Discharge", unit="m3/s", interpretation=Instantaneous, color=Red, linewidth=4, linestyle=Dash, showPoints=True

Custom file import settings

It is also possible to specify custom import settings for a file. This is useful for generic text or csv files.

Example with all possible settings:

file=myrandom.csv
 # custom import settings
 isColumnSeparated=True
 separator=;
 dateformat=dd.MM.yyyy HH:mm:ss
 decimalSeparator=,
 iLineHeadings=1
 iLineUnits=8
 iLineData=12
 useUnits=True
 columnWidth=
 dateTimeColumnIndex=0
 # series to import
 series=myseries1
 series=myseries2

The accepted import settings are described below:

  • isColumnSeparated: whether the columns are separated by a character (True) or are fixed width (False). Default: True
  • separator: the column separator (only relevant if isColumnSeparated=True). Default: ;, possible values: space, tab, ,, or any other single-character string
  • columnWidth: the column width (only relevant if isColumnSeparated=False). Default: 16
  • dateformat: the date format (see help). Default: dd.MM.yyyy HH:mm
  • decimalSeparator: the decimal separator for numbers. Default: .
  • iLineHeadings: the number of the line containing the headings. Default: 1
  • iLineUnits: the number of the line containing the units. Default: 2
  • iLineData: the number of the first line of data. Default: 3
  • useUnits: whether to read units from the file. Default: True
  • dateTimeColumnIndex: The 0-based index of the column containing date time values. Default: 0

Notes

  • all whitespace apart from linebreaks in the project file is optional
  • lines starting with # are ignored (treated as comments)
  • support for this file was added in v1.6.1 (r445)
  • support for specifying custom file import settings was added in v1.6.2 (r481)
  • support for keyword options was added in v2.6.0