pyva.data.matrixClasses.ShapeSignal
- class pyva.data.matrixClasses.ShapeSignal(mesh, xdata, ydata, dof)
Bases:
Signal
Class for Signals with link to shapes ydata can be reprented by ndarrays but also function definition
- xdata
x-axis samples @type DataAxis
- ydata
array of Signal samples with dimension Ndof x Nxdata @type np.array or function with ndarray output of (Ndofs,Nxdata(]) output dof: DOF object with ID, local DOF and type of ydata channels
- __init__(mesh, xdata, ydata, dof)
constructor for Signal classes with link to 2D meshes
- Parameters:
mesh (meshtypes) – mesh that links the DOFs to positions
xdata (DataAxis) – in depth data of Signals e.g. time, frequency
ydata (ndarray of size (Ndof,Nxdata) or function with input arguments (pos_x<,posy,posz,>,xdata) depending on mesh position arguments) – DESCRIPTION.
dof (TYPE, optional) – DESCRIPTION. The default is dof.DOF(0,0,dof.DOFtype(typeID = 0)).
- Raises:
ValueError – input is checked for consistency.
- Return type:
None.
Methods
__init__
(mesh, xdata, ydata, dof)constructor for Signal classes with link to 2D meshes
conj
()getdof
()imag
()inf2zero
()sets all infs to zero
interp
(xvalues[, ix])interpolation for Signals
isa
(typestr)nan2zero
()sets all 'NaN's to zero
plot
(nfig[, loc, res, xscale, yscale])Plot method for Signal obejcts.
plot3d
([fig, index])pressure
(ID)Exctracts the pressure from Signals
real
()setdof
(value)sum
()sum of Signals
transfer
(other[, IDs])Calculates the transfer function of similar types between differnt DOFs
volume_flow
(ID[, dofarg, S])Exctracts the volume flow from Signals
Attributes
Number of Signal channels
Number of DataAxis samples
dof
- property Nsig
Number of Signal channels
- Returns:
Number of Signal DOFs.
- Return type:
int
- property Nxdata
Number of DataAxis samples
- Returns:
Number of samples.
- Return type:
int
- interp(xvalues, ix=0)
interpolation for Signals
Provides interpolated values when sample is not given
- Parameters:
xvalues (double) – xvalues for interpolation from Signal
ix (integer, optional) – Signal index. The default is 0.
- Returns:
interpolated ydata values for Signal of index ix
- Return type:
ndarray
- plot(nfig, loc=1, res='mag', xscale='linear', yscale='linear', **kwargs)
Plot method for Signal obejcts.
- Parameters:
nfig (TYPE) – number of figure.
loc (int or str, optional) – location of legend. The default is 1.
res (str, optional) – kind of result mag, phase, real, imag. The default is ‘mag’.
xscale (str, optional) – linear or log. The default is ‘linear’.
yscale (str, optional) –
- linear or log. The default is ‘linear’.
ls : line style
**kwargs – Arbitrary argument list.
ID (IDs to plot) –
dof (DOFs to plot e.g. [1,2]) –
legstr (additional label added to automatic label) –
fulllegstr (list of labels overwriting the automatic label) –
DX (int) – value for skipping x samples DX=2 skips every second sample
lw (list or tuple) – line width
cs (list or tuple) – colorstyle
ms (list or tuple) – markerstyle
ls (list or tuple) – line_styles
- Raises:
ValueError – DESCRIPTION.
- Return type:
None.
- pressure(ID)
Exctracts the pressure from Signals
- Parameters:
ID (int) – node ID.
- Returns:
extracted pressure Signal.
- Return type:
- sum()
sum of Signals
For reasonable results DOFtype must not change
- Returns:
sum of all DOFs per x-axis.
- Return type:
- transfer(other, IDs=None)
Calculates the transfer function of similar types between differnt DOFs
- volume_flow(ID, dofarg=1, S=1.0)
Exctracts the volume flow from Signals
- Parameters:
ID (int) – node ID.
dofarg (int, optional) – local degree of freedom. The default is 1.
S (float, optional) – DESCRIPTION. The default is 1..
- Raises:
ValueError – DESCRIPTION.
- Returns:
of volume flow DOFs.
- Return type: