Wave project file: Difference between revisions

From BlueM
Jump to navigation Jump to search
(Created page with "{{Wave_nav}} 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. The format is as fol...")
 
(switch to formatted source)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Wave_nav}}
{{Wave_nav}}


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.
<div style="float:right; margin:0 0 1em 1em">__TOC__</div>


The format is as follows:
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).
<pre>
file=path\to\file1
series=series1
series=series2: optional title
file=path\to\file2
series=series3: optional title
series=series4
</pre>


Example:
The basic format is as follows:
<pre>
<source lang="wvp">
file=hwmerk_rur.wel
file=<path\to\file>
  series=ERUR_1AB
  series=<series name>
  series=EOLF_1AB
  series=<series name>
  series=EURF_1AB
file=<path\to\file>
  series=EIND_1AB
  series=<series name>
series=EWUR_1AB
  series=<series name>
  series=EMRZ_1AB
</source>
series=SMAU_1AB
 
  series=S456_1AB: "S456_1AB - Selhausen"
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.
  series=S397_1AB: "S397_1AB - Altenburg 1"
 
series=S357_1AB: "S357_1AB - Jülich Stadion"
The <code>series</code> 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.
  series=S247_1AB: "S247_1AB - Linnich 1"
 
series=S008_1AB: "S008_1AB - Stah"
'''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"
</source>
 
==Custom titles==
It is possible to specify custom titles by writing the custom title after a colon (<code>:</code>) behind the series name:
<source lang="wvp">
  series=<series name>:my custom title
</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.:
<source lang="wvp">
  series=<series name>:"my , very = custom title"
</source>
 
==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:
<source lang="wvp">
  series=<series name>:<keyword>=<value>, <keyword>=<value>, ...
</source>
'''Note:''' When using keyword options, any custom title must also be specified using the appropriate <code>title</code> keyword.
 
The following keywords are supported:
* <code>title</code>: assigns a custom title
* <code>unit</code>: assigns the specified unit
* <code>interpretation</code>: assigns the specified [[Wave:Interpretation|interpretation]], must be the name of one of the members of [https://bluemodel.github.io/BlueM.Wave/api/BlueM.Wave.TimeSeries.InterpretationEnum.html <code>BlueM.Wave.TimeSeries.InterpretationEnum</code>], possible values:
** <code>Instantaneous</code>
** <code>BlockRight</code>
** <code>BlockLeft</code>
** <code>Cumulative</code>
** <code>CumulativePerTimestep</code>
** <code>Undefined</code>
* <code>color</code>: assigns the specified color, can be the name of one of the members of [https://learn.microsoft.com/en-us/dotnet/api/system.drawing.knowncolor?view=netframework-4.8.1 <code>System.Drawing.KnownColor</code>] (e.g. <code>Red</code>) or a hexadecimal representation of ARGB values (e.g. <code>ffff0000</code>)
* <code>linewidth</code>: assigns the specified line width (default is <code>2</code>)
* <code>linestyle</code>: assigns the specified line style, must be the name of one of the members of [https://learn.microsoft.com/en-us/dotnet/api/system.drawing.drawing2d.dashstyle?view=netframework-4.8.1 <code>System.Drawing.Drawing2D.DashStyle</code>], possible values:
** <code>Solid</code> (default)
** <code>Dash</code>
** <code>Dot</code>
** <code>DashDot</code>
** <code>DashDotDot</code>
* <code>showpoints</code>: whether to display series points, must be <code>True</code> or <code>False</code>, default is <code>False</code>


'''Notes:'''
'''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 (<code>=</code>) or a comma (<code>,</code>)
==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:
<source lang="wvp">
# 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
</source>
==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:
<source lang="wvp">
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
</source>
The accepted import settings are described below:
* <code>isColumnSeparated</code>: whether the columns are separated by a character (<code>True</code>) or are fixed width (<code>False</code>). Default: <code>True</code>
* <code>separator</code>: the column separator (only relevant if <code>isColumnSeparated=True</code>). Default: <code>;</code>, possible values: <code>space</code>, <code>tab</code>, <code>,</code>, or any other single-character string
* <code>columnWidth</code>: the column width (only relevant if <code>isColumnSeparated=False</code>). Default: <code>16</code>
* <code>dateformat</code>: the date format (see [https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings help]). Default: <code>dd.MM.yyyy HH:mm</code>
* <code>decimalSeparator</code>: the decimal separator for numbers. Default: <code>.</code>
* <code>iLineHeadings</code>: the number of the line containing the headings. Default: <code>1</code>
* <code>iLineUnits</code>: the number of the line containing the units. Default: <code>2</code>
* <code>iLineData</code>: the number of the first line of data. Default: <code>3</code>
* <code>useUnits</code>: whether to read units from the file. Default: <code>True</code>
* <code>dateTimeColumnIndex</code>: The 0-based index of the column containing date time values. Default: <code>0</code>
==Notes==
* all whitespace apart from linebreaks in the project file is optional
* lines starting with <code>#</code> are ignored (treated as comments)
* support for this file was added in v1.6.1 (r445)
* support for this file was added in v1.6.1 (r445)
* the path to the file can be specified as an absolute path or as a relative path (relative to the project file)
* support for specifying custom file import settings was added in v1.6.2 (r481)
* if no series are specified, all series contained in the file will be loaded
* support for keyword options was added in v2.6.0
* all whitespace in the project file is optional (apart from linebreaks)


[[Category:BlueM.Wave]]
[[Category:BlueM.Wave]]

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