ocmw.dataproc.otm_vectorfield module¶
Functions for extracting velocity, velocity gradient, and vorticity 2D fields from Open Telemac-Mascret model output.
Get Selafin structure data to set parameters for the vector field data |
|
Get timeseries of data for the requested nodes and field variable |
|
Get variable data for all mesh nodes at the requested time step |
|
Get the 2-D vector field data at a specifc geospatial location |
|
Calculate a timeseries of characteristic parameters for a given model node |
|
Generate a series of single time 2D velocity field data for animations |
|
Get subset of time steps for batch process generation of animation frames from 2D model fields. |
|
Generate a series of single time 2D circulation data files for animations. |
|
Merge a set of circulation data frames into a single data strcuture. |
|
Calculate field gradients and vorticty for a set of nodes in a batch process and save to a set file for merging. |
|
Calculate field gradients and vorticty at nodes inside a polygon and save to an OCMW format output file. |
|
Calculate dynamic parameters for a specifc geospatial location |
Functions for extracting velocity, velocity gradient, and vorticity 2D fields from Open Telemac-Mascret model output.
Chris Old IES, School of Engineering, University of Edinburgh Sep 2023
- ocmw.dataproc.otm_vectorfield.initialiseVectorField(slf)[source]¶
Get Selafin structure data to set parameters for the vector field data
- Parameters:
slf (Selafin obj) – Selafin file handle.
- Returns:
times (numpy.ndarray, float) – Timestamp as an offset in seconds from idate.
idate (numpy.ndarray, int32) – Start time as an array of integers [year,month,day,hour,minute,second].
nsteps (int) – Number of time steps in file.
nnodes (int) – Number of mesh nodes.
meshx (numpy.ndarray, float) – X coordinate of mesh node locations.
meshy (numpy.ndarray, float) – Y coordinate of mesh node locations.
elems (numpy.ndarray, int32) – Indices of nodes that define each mesh triangular element.
edges (numpy.ndarray, int32) – Indices of node that define every element edge.
- ocmw.dataproc.otm_vectorfield.getVariableAtNodes(slf, nodes, varIndex)[source]¶
Get timeseries of data for the requested nodes and field variable
- ocmw.dataproc.otm_vectorfield.getVariablesAtTime(slf, frame, varIndex)[source]¶
Get variable data for all mesh nodes at the requested time step
- ocmw.dataproc.otm_vectorfield.vectorFieldAtLocation(slf, Loc, d_off=0.0)[source]¶
Get the 2-D vector field data at a specifc geospatial location
- Parameters:
- Returns:
vect (dict) – Dictionary strcutre containing the vector field data at the location.
- ocmw.dataproc.otm_vectorfield.characteriseAtNode(slf, node)[source]¶
Calculate a timeseries of characteristic parameters for a given model node
- Parameters:
slf (Selfin obj) – Handle to the Selafin file being processed.
node (int) – Node index.
- Returns:
vect (dict) – Dictionary structure containing timeseries of characteristic parameter at the node requested.
- ocmw.dataproc.otm_vectorfield.getVelocityField(slfHnd, mesh, dispFreq=5000)[source]¶
Generate a series of single time 2D velocity field data for animations
- ocmw.dataproc.otm_vectorfield.frameSetIndices(nFrames, nCores, setNum)[source]¶
Get subset of time steps for batch process generation of animation frames from 2D model fields.
- ocmw.dataproc.otm_vectorfield.getCirculationField(slfHnd, mesh, tsteps=[], dispFreq=5000)[source]¶
Generate a series of single time 2D circulation data files for animations.
- ocmw.dataproc.otm_vectorfield.mergeCirculationFrames(dataPath, fileList)[source]¶
Merge a set of circulation data frames into a single data strcuture.
- ocmw.dataproc.otm_vectorfield.processNodeSet(fPath, fName, nCores=1, setNum=0)[source]¶
Calculate field gradients and vorticty for a set of nodes in a batch process and save to a set file for merging.
- ocmw.dataproc.otm_vectorfield.processNodesInPolygon(fPath, fName, polygon)[source]¶
Calculate field gradients and vorticty at nodes inside a polygon and save to an OCMW format output file.
- ocmw.dataproc.otm_vectorfield.processLocation(filePath, runStr, suffix, Loc, depthOffset: float = 0.0, modelVer=None, saveData=False)[source]¶
Calculate dynamic parameters for a specifc geospatial location
- Parameters:
filePath (str) – File path to Selfin file containing 2D fields.
runStr (str) – Selfin file with out “_2D.slf”.
suffix (str) – Identifier string for location.
Loc (list, float) – Coordinates of the geospatial location [x,y].
depthOffset (float, optional) – Mean sea level correction used in model configuration. The default is 0.0.
modelVer (int, optional) – Model version number. The default is None.
saveData (bool, optional) – Toggle for activating saving data to a file. The default is False.
- Returns:
vect (dict) – Dictionary structure containing the parameters at the requested location.