Wave project file: Difference between revisions

From BlueM
Jump to navigation Jump to search
(custom import settings (#720))
(switch to formatted source)
 
(3 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>
 
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\file1
file=<path\to\file>
  series=series1
  series=<series name>
  series=series2: optional title
  series=<series name>
file=path\to\file2
file=<path\to\file>
  series=series3: optional title
series=<series name>
  series=series4
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>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.
 
'''Note:''' If the series name contains a colon (<code>:</code>), the name has to be enclosed in quotes, e.g.:
<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:'''
* 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==
==Example==
This is a 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">
# Read multiple file types
# Import multiple series from multiple files
#-------------------------
#-------------------------------------------
file=REG_SMUSI\N74235_Mue_10aV2.reg
file=..\UVF\42960.0_q_28.uvf
file=UVF\42960.0_q_28.uvf
file=..\WEL\DEMONA_PSI.wel
file=WEL\DEMONA_PSI.wel
  series=S3  _1AB: S3 outflow
  series=S3  _1AB: "S3_1AB"
  series=S3  _1ZU: S3 inflow
  series=S3  _1ZU: "S3_1ZU"
file=..\ZRE\Zufl_gem.zre
file=WEL_GISMO\BEK_WEL.asc
file=..\BIN\abfluss_1.bin
  series=BEK_NH4Bek: "NH4 concentration"
  series=abfluss_1.bin: title="Discharge", unit="m3/s", interpretation=Instantaneous, color=Red, linewidth=4, linestyle=Dash, showPoints=True
file=WEL_TALSIM\TALSIM.wel
</source>
series=S103_1AB
file=ZRE\Olef_Zufl_gem.zre
file=ZRXP\Q2.1440.zrx
</pre>


==Custom import settings==
==Custom file import settings==
It is also possible to specify custom import settings. This is useful for generic text or csv files.
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:
Example with all possible settings:
<pre>
<source lang="wvp">
file=myrandom.csv
file=myrandom.csv
  # custom import settings
  # custom import settings
Line 51: 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:
* <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>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>
* <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>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>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>
Line 67: Line 116:
==Notes==
==Notes==
* all whitespace apart from linebreaks in the project file is optional
* all whitespace apart from linebreaks in the project file is optional
* the path to the file can be specified as an absolute path or as a relative path (relative to the project file)
* if a file is specified without specifying which series should be imported, all series contained in the file will be imported
* lines starting with <code>#</code> are ignored (treated as comments)
* 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)
* support for specifying custom import settings was added in v1.6.2 (r481)
* support for specifying custom file import settings was added in v1.6.2 (r481)
* support for keyword options was added in v2.6.0


[[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