Template:Dataset Calculator: Difference between revisions
No edit summary |
|||
Line 31: | Line 31: | ||
Includes: +, -, *, /. (addition, subtraction, multiplication, division) | Includes: +, -, *, /. (addition, subtraction, multiplication, division) | ||
=====Example 1 – mathematical operation:===== | =====Example 1 – mathematical operation:===== | ||
{|- | |||
|''Dataset table'': | |||
| | |||
variable name "D" representing the water depth dataset<br> | |||
variable name "Z" representing the ground elevation dataset | |||
|- | |||
|''Mathematical expression:'' | |||
| D + Z | |||
|- | |||
| ''Output dataset name:'' | |||
| WSE (new dataset representing the water surface elevation) | |||
|} | |||
====Trigonometric operations==== | ====Trigonometric operations==== | ||
Includes: sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh, arcsinh, arccosh, arctanh | Includes: sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh, arcsinh, arccosh, arctanh |
Revision as of 20:56, 9 July 2024
Dataset Calculator
The Dataset Calculator tool will perform calculations on one or more dataset data and activity. The tool will produce a new dataset with the resulting values and activity of those datasets according to the provided mathematical expression.
It should be noted that datasets at different locations (point vs. cell) cannot be used in the same expression.
Input Parameters
- Grid source selection – Select the geometry on which the dataset calculation will be performed. The geometry can be a 2D mesh, scatter set, grid or UGrid. The cells or points in the geometry define the locations where data from the dataset exists and the locations for the calculations specified in the tool.
- Data location selection – Determines the location of the calculations in the geometry. 2D meshes and scatter sets only support point datasets. UGrids supports both point and cell datasets. Cartesian grids can be of one type or the other.
- "Cells" – Calculations will be performed on the cell values of the geometry.
- "Points" – Calculations with be performed on the point values of the geometry.
- Dataset table – Can be populated with the datasets from the select Grid source selection. This table allows selecting which datasets are to be used and specify a variable name for each that will appear in the expression. The default variable names follow the pattern of d1, d2, etc., but user specified names can be specified as well. Not all datasets selected in the table need to be used in the expression.
- Dataset – The selected dataset.
- Variable Name – The name to be used to refer to the chosen dataset within the provided expression.
- Time Step – The chosen time step from which to use data from this dataset. Or select all time steps to use all values within this dataset.
- Mathematical expression – The equation or expression that will be evaluated at each location in the dataset. Parentheses can be used in the expression as in mathematical notation.
Output Parameters
- Output Dataset Name – the name of the new dataset to fill with the resulting values from the expression.
The output will be a new dataset on the chosen grid with values and activity according to the expression and chosen datasets.
Current Location in toolbox
Datasets/ Dataset Calculator
Example expressions
Traditional mathematical symbols
Includes: +, -, *, /. (addition, subtraction, multiplication, division)
Example 1 – mathematical operation:
Dataset table: |
variable name "D" representing the water depth dataset |
Mathematical expression: | D + Z |
Output dataset name: | WSE (new dataset representing the water surface elevation) |
Trigonometric operations
Includes: sin, cos, tan, arcsin, arccos, arctan, arctan2, sinh, cosh, tanh, arcsinh, arccosh, arctanh
Example 2 – trig function:
- Dataset table: variable name "AMP" representing the amplitude dataset
variable name "PHASE" representing the phase dataset
- Mathematical expression: AMP * sin( PHASE)
- Output dataset name: WSE (new dataset representing the water surface elevation)
Mathematical functions
Includes: log, log10, exp, sqrt, abs
Example 3 – square root:=
- Dataset table: variable name "V" representing the velocity magnitude dataset
variable name "D" representing the water depth dataset
- Mathematical expression: V/sqrt(32.2 * D)
- Output dataset name: FR (new dataset representing the Froude number at the computation location)
Example 4 – exponent:
- Dataset table: variable name "Vx" representing the velocity in the X direction dataset
variable name "Vy" representing the velocity in the Y direction dataset
- Mathematical expression: sqrt(exp(Vx, 2) + exp(Vy, 2))
- Output dataset name: Vmag (new dataset representing the velocity magnitude at the computation location)
Conditional statements
Where(bool, number1, number2)
Example 5 – Min, max or conditional:
- Dataset table: variable name "WSE1" representing the first water surface dataset
variable name "WSE2" representing the second water surface dataset
- Mathematical expression: where(WSE1 > WSE2, WSE1, WSE2)
- Output dataset name: MaxWSE (new dataset representing the maximum water surface)
Example 6 - truncation (nested conditional):
- Dataset table: variable name "SIZE" representing the nodal spacing (size) dataset
- Mathematical expression: where(SIZE < 20, 20, where(size > 50, 50, SIZE)
- Output dataset name: TRUNCSIZE (new dataset representing a truncated size dataset)