Defined as:
sdynpy.core.sdynpy_data.NDDataArrayModule:
sdynpy.core.sdynpy_dataSource: GitHub
Parent:
sdynpy.SdynpyArrayParent:
numpy.ndarray
Signature¶
class sdynpy.NDDataArray(shape, nelements, data_dimension, ordinate_dtype='float64', buffer=None, offset=0, strides=None, order=None)Generic N-Dimensional data structure
This data structure can contain real or complex data. More specific SDynPy data arrays inherit from this superclass.
Attributes¶
| Name | Summary |
|---|---|
abscissa_spacing | The spacing of the abscissa in the function. Returns ValueError if abscissa are not evenly spaced. |
data_dimension | Number of dimensions to the data |
function_type | Returns the function type of the data array as a FunctionTypes Enum |
idx_by_ab | AbscissaValueExtractor that can be indexed to extract an abscissa range |
idx_by_el | AbscissaIndexExtractor that can be indexed to extract specific elements |
num_coordinates | Number of coordinates defining the data array |
num_elements | Number of elements in each data array |
reference_coordinate | CoordinateArray corresponding to the response coordinates |
response_coordinate | CoordinateArray corresponding to the response coordinates |
abscissa_spacing¶
The spacing of the abscissa in the function. Returns ValueError if abscissa are not evenly spaced.
data_dimension¶
Number of dimensions to the data
function_type¶
Returns the function type of the data array as a FunctionTypes Enum
idx_by_ab¶
AbscissaValueExtractor that can be indexed to extract an abscissa range
idx_by_el¶
AbscissaIndexExtractor that can be indexed to extract specific elements
num_coordinates¶
Number of coordinates defining the data array
num_elements¶
Number of elements in each data array
reference_coordinate¶
CoordinateArray corresponding to the response coordinates
response_coordinate¶
CoordinateArray corresponding to the response coordinates
Methods¶
| Name | Summary |
|---|---|
argmax | Returns the index of the maximum ordinate in the data array |
argmin | Returns the index of the minimum ordinate in the data array |
downsample | Downsample a signal by keeping only every n-th abscissa/ordinate pair. |
extract_elements | Parses elements from the data array specified by the passed indices |
extract_elements_by_abscissa | Extracts elements with abscissa values within the specified range |
from_uff | Create a data array from a unv dictionary from read_unv |
from_unv | Create a data array from a unv dictionary from read_unv |
get_drive_points | Returns data arrays where the reference is equal to the response |
get_reciprocal_data | Gets reciprocal pairs of data from an NDDataArray. |
gui_plot | Create a GUIPlot window to visualize data. |
interpolate | Interpolates the NDDataArray using SciPy’s interp1d. |
join | Joins several data arrays together by concatenating their ordinates |
load | Load in the specified file into a SDynPy array object |
max | Returns the maximum ordinate in the data array |
min | Returns the minimum ordinate in the data array |
plot | Plot the data array |
plot_image | |
reshape_to_matrix | Reshapes a data array to a matrix with response coordinates along the rows and reference coordinates along the columns |
save | Save the array to a numpy file |
shape_filter | Spatially filters the data using the specified ShapeArray. |
to_imat_struct | Creates a Matlab structure that can be read the IMAT toolbox. |
to_imat_struct_array | Creates a Matlab structure that can be read the IMAT toolbox. |
to_shape_array | Converts an NDDataArray to a ShapeArray |
transform_coordinate_system | Performs coordinate system transformations on the data |
validate_common_abscissa | Returns True if all functions have the same abscissa |
zero_pad | Add zeros to the beginning or end of a signal |
argmax¶
Source: GitHub
def sdynpy.NDDataArray.argmax(self, reduction=None, *argmax_args, **argmax_kwargs)Returns the index of the maximum ordinate in the data array
Parameters¶
reduction : function, optional Optional function to modify the data, e.g. to select maximum of the absolute value. The default is None.
*argmax_args : various Additional arguments passed to np.argmax
**argmax_kwargs : various Additional keyword arguments passed to np.argmax
Returns¶
int
Index of the maximum of the flattened ordinate. Use
np.unravel_index with self.ordinate.shape to get the unflattened
index.
argmin¶
Source: GitHub
def sdynpy.NDDataArray.argmin(self, reduction=None, *argmin_args, **argmin_kwargs)Returns the index of the minimum ordinate in the data array
Parameters¶
reduction : function, optional Optional function to modify the data, e.g. to select minimum of the absolute value. The default is None.
*argmin_args : various Additional arguments passed to np.argmax
**argmin_kwargs : various Additional keyword arguments passed to np.argmax
Returns¶
int
Index of the minimum of the flattened ordinate. Use
np.unravel_index with self.ordinate.shape to get the unflattened
index.
downsample¶
Source: GitHub
def sdynpy.NDDataArray.downsample(self, factor)Downsample a signal by keeping only every n-th abscissa/ordinate pair.
Parameters¶
factor : int Downsample factor. Only the factor-th abcissa will be kept.
Returns¶
NDDataArray
The downsampled data object
extract_elements¶
Source: GitHub
def sdynpy.NDDataArray.extract_elements(self, indices)Parses elements from the data array specified by the passed indices
Parameters¶
indices Any type of indices into a np.ndarray to select the elements to keep
Returns¶
NDDataArray
Array reduced to specified elements
extract_elements_by_abscissa¶
Source: GitHub
def sdynpy.NDDataArray.extract_elements_by_abscissa(self, min_abscissa, max_abscissa)Extracts elements with abscissa values within the specified range
Parameters¶
min_abscissa : float Minimum abscissa value to keep
max_abscissa : float Maximum abscissa value to keep.
Returns¶
NDDataArray
Array reduced to specified elements.
from_uff¶
Source: GitHub
def sdynpy.NDDataArray.from_uff(unv_data_dict, squeeze=True)Create a data array from a unv dictionary from read_unv
Parameters¶
unv_data_dict : dict Dictionary containing data from read_unv
squeeze : bool, optional Automatically reduce dimension of the read data if possible. The default is True.
Returns¶
return_functions : NDDataArray Data read from unv
from_unv¶
Source: GitHub
def sdynpy.NDDataArray.from_unv(unv_data_dict, squeeze=True)Create a data array from a unv dictionary from read_unv
Parameters¶
unv_data_dict : dict Dictionary containing data from read_unv
squeeze : bool, optional Automatically reduce dimension of the read data if possible. The default is True.
Returns¶
return_functions : NDDataArray Data read from unv
get_drive_points¶
Source: GitHub
def sdynpy.NDDataArray.get_drive_points(self, return_indices=False)Returns data arrays where the reference is equal to the response
Parameters¶
return_indices : bool, optional If True, it will return a set of indices into the original array that extract the drive point functions. If False, then the drive point functions are returned directly. The default is False.
Returns¶
np.ndarray or NDDataArray subclass
If return_indices is True, this will return the indices into the
original array that extract the drive point data. If return_indices
is False, this will return the drive point NDDataArrays directly.
Raises¶
ValueError
If the data does not have reference and response coordinates, the
method will raise a ValueError.
get_reciprocal_data¶
Source: GitHub
def sdynpy.NDDataArray.get_reciprocal_data(self, return_indices=False)Gets reciprocal pairs of data from an NDDataArray.
Parameters¶
return_indices : bool, optional If True, it will return a set of indices into the original array that extract the reciprocal functions. If False, then the reciprocal functions are returned directly. The default is False.
Returns¶
np.ndarray or NDDataArray subclass
If return_indices is True, this will return the indices into the
original array that extract the reciprocal data. If return_indices
is False, this will return the reciprocal NDDataArrays directly.
Raises¶
ValueError
If the data does not have reference and response coordinates, the
method will raise a ValueError.
gui_plot¶
Source: GitHub
def sdynpy.NDDataArray.gui_plot(self, abscissa_markers=None, abscissa_marker_labels=None, abscissa_marker_type=None, legend_label=None)Create a GUIPlot window to visualize data.
Parameters¶
abscissa_markers : np.ndarray Abscissa values at which markers will be placed. If not specified, no markers will be added. Markers will be added to all plotted curves if this argument is passed.
abscissa_marker_labels : str or iterable Labels that will be applied to the markers. If not specified, no label will be applied. If a single string is passed, it will be passed to the
.formatmethod with keyword argumentsindexandabscissa. Otherwise there should be one string for each marker.abscissa_marker_type : str: The type of marker that will be applied. Can be ‘vline’ for a vertical line across the axis, or it can be a pyqtgraph symbol specifier (e.g. ‘x’, ‘o’, ‘star’, etc.) which will be placed on the plotted curves. If not specified, a vertical line will be used.
Returns¶
GUIPlot
interpolate¶
Source: GitHub
def sdynpy.NDDataArray.interpolate(self, interpolated_abscissa, kind='linear', **kwargs)Interpolates the NDDataArray using SciPy’s interp1d.
Parameters¶
interpolated_abscissa : ndarray Abscissa values at which to interpolate the function. If multi-dimensional, it will be flattened.
kind : str or int, optional Specifies the kind of interpolation as a string or as an integer specifying the order of the spline interpolator to use. The string has to be one of ‘linear’, ‘nearest’, ‘nearest-up’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, or ‘next’. ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point; ‘nearest-up’ and ‘nearest’ differ when interpolating half-integers (e.g. 0.5, 1.5) in that ‘nearest-up’ rounds up and ‘nearest’ rounds down. ‘logx’, ‘logy’, and ‘loglog’ use linear interpolation on the values converted to log scale. Default is ‘linear’.
**kwargs Additional arguments to scipy.interpolate.interp1d.
Returns¶
NDDataArray Array with interpolated arguments
join¶
Source: GitHub
def sdynpy.NDDataArray.join(cls, data_arrays, increment_abscissa=True)Joins several data arrays together by concatenating their ordinates
Parameters¶
data_arrays : NDDataArray Arrays to concatenate
increment_abscissa : bool, optional Determines how the abscissa concatenation is handled. If False, the abscissa is left as it was in the original functions. If True, it will be incremented so it is continuous.
Returns¶
NDDataArray subclass
load¶
Source: GitHub
def sdynpy.NDDataArray.load(cls, filename)Load in the specified file into a SDynPy array object
Parameters¶
filename : str Filename specifying the file to load. If the filename has extension .unv or .uff, it will be loaded as a universal file. Otherwise, it will be loaded as a NumPy file.
Returns¶
cls
SDynpy array of the appropriate type from the loaded file.
Raises¶
AttributeError
Raised if a unv file is loaded from a class that does not have a
from_unv attribute defined.
max¶
Source: GitHub
def sdynpy.NDDataArray.max(self, reduction=None, *max_args, **max_kwargs)Returns the maximum ordinate in the data array
Parameters¶
reduction : function, optional Optional function to modify the data, e.g. to select maximum of the absolute value. The default is None.
*max_args : various Additional arguments passed to np.max
**max_kwargs : various Additional keyword arguments passed to np.max
Returns¶
Value
Maximum value in the ordinate.
min¶
Source: GitHub
def sdynpy.NDDataArray.min(self, reduction=None, *min_args, **min_kwargs)Returns the minimum ordinate in the data array
Parameters¶
reduction : function, optional Optional function to modify the data, e.g. to select minimum of the absolute value. The default is None.
*min_args : various Additional arguments passed to np.min
**min_kwargs : various Additional keyword arguments passed to np.min
Returns¶
Value
Minimum value in the ordinate.
plot¶
Source: GitHub
def sdynpy.NDDataArray.plot(self, one_axis: bool = True, subplots_kwargs: dict = {}, plot_kwargs: dict = {}, abscissa_markers=None, abscissa_marker_labels=None, abscissa_marker_type='vline', abscissa_marker_plot_kwargs={})Plot the data array
Parameters¶
one_axis : bool, optional Set to True to plot all data on one axis. Set to False to plot data on multiple subplots. one_axis can also be set to a matplotlib axis to plot data on an existing axis. The default is True.
subplots_kwargs : dict, optional Keywords passed to the matplotlib subplots function to create the figure and axes. The default is {}.
plot_kwargs : dict, optional Keywords passed to the matplotlib plot function. The default is {}.
abscissa_markers : ndarray, optional Array containing abscissa values to mark on the plot to denote significant events.
abscissa_marker_labels : str or ndarray Array of strings to label the abscissa_markers with, or alternatively a format string that accepts index and abscissa inputs (e.g. ‘{index:}: {abscissa:0.2f}’). By default no label will be applied.
abscissa_marker_type : str The type of marker to use. This can either be the string ‘vline’ or a valid matplotlib symbol specifier (e.g. ‘o’, ‘x’, ‘.’).
abscissa_marker_plot_kwargs : dict Additional keyword arguments used when plotting the abscissa label markers.
Returns¶
axis : matplotlib axis or array of axes On which the data were plotted
plot_image¶
Source: GitHub
def sdynpy.NDDataArray.plot_image(self, ax=None, reduction_function=None, colorbar_scale='linear', colorbar_min=None, colorbar_max=None)reshape_to_matrix¶
Source: GitHub
def sdynpy.NDDataArray.reshape_to_matrix(self, error_if_missing=True)Reshapes a data array to a matrix with response coordinates along the rows and reference coordinates along the columns
Parameters¶
error_if_missing : bool If True, an error will be thrown if there are missing data objects when trying to make a matrix of functions (i.e. if a response degree of freedom is missing from one reference). If False, response coordinates will simply be discarded if they do not exist for all references. Default is True.
Returns¶
output_array : Data Aarray 2D Array of NDDataArray
save¶
Source: GitHub
def sdynpy.NDDataArray.save(self, filename, compress_abscissa=False)Save the array to a numpy file
Parameters¶
filename : str Filename that the array will be saved to. Will be appended with .npz if not specified in the filename
compress_abscissa : bool, optional If True, abscissa will be stored as start and step instead of full arrays. If abscissa cannot be compressed and maintain values, a ValueError will be raised.
shape_filter¶
Source: GitHub
def sdynpy.NDDataArray.shape_filter(self, shape, filter_responses=True, filter_references=False, rcond=None)Spatially filters the data using the specified ShapeArray.
Parameters¶
shape : ShapeArray A set of shapes used to filter the data
filter_responses : bool, optional If True, will filter the response degrees of freedom. The default is True.
filter_references : bool, optional If True, will filter the reference degrees of freedom. The default is False.
rcond : float, optional Condition number threshold used in the pseudoinverse to compute the inverse of the specified shape arrays. The default is None.
Returns¶
filtered_data : NDDataArray or subclass The type of the output will be the same type as the input, but filtered such that the degrees of freedom correspond to the shapes in the provided ShapeArray
Raises¶
ValueError
Raised if the abscissa are not consistent across all data.
to_imat_struct¶
Source: GitHub
def sdynpy.NDDataArray.to_imat_struct(self, Version=None, SetRecord=None, CreateDate: datetime.datetime = None, ModifyDate: datetime.datetime = None, OwnerName=None, AbscissaDataType=None, AbscissaTypeQual=None, AbscissaAxisLab=None, AbscissaUnitsLab=None, OrdNumDataType=None, OrdNumTypeQual=None, OrdDenDataType=None, OrdDenTypeQual=None, OrdinateAxisLab=None, OrdinateUnitsLab=None, ZAxisDataType=None, ZAxisTypeQual=None, ZGeneralValue=None, ZRPMValue=None, ZOrderValue=None, ZTimeValue=None, UserValue1=None, UserValue2=None, UserValue3=None, UserValue4=None, SamplingType=None, WeightingType=None, WindowType=None, AmplitudeUnits=None, Normalization=None, OctaveFormat=None, OctaveAvgType=None, ExpDampingFact=None, PulsesPerRev=None, MeasurementRun=None, LoadCase=None, IRIGTime=None)Creates a Matlab structure that can be read the IMAT toolbox.
This structure can be read by the IMAT toolbox in Matlab to create an imat_fn object. Note this is generally a faster function than to_imat_struct_array.
Parameters¶
Version : TYPE, optional DESCRIPTION. The default is None.
SetRecord : TYPE, optional DESCRIPTION. The default is None.
CreateDate : datetime, optional DESCRIPTION. The default is None.
ModifyDate : datetime, optional DESCRIPTION. The default is None.
OwnerName : TYPE, optional DESCRIPTION. The default is None.
AbscissaDataType : TYPE, optional DESCRIPTION. The default is None.
AbscissaTypeQual : TYPE, optional DESCRIPTION. The default is None.
AbscissaAxisLab : TYPE, optional DESCRIPTION. The default is None.
AbscissaUnitsLab : TYPE, optional DESCRIPTION. The default is None.
OrdNumDataType : TYPE, optional DESCRIPTION. The default is None.
OrdNumTypeQual : TYPE, optional DESCRIPTION. The default is None.
OrdDenDataType : TYPE, optional DESCRIPTION. The default is None.
OrdDenTypeQual : TYPE, optional DESCRIPTION. The default is None.
OrdinateAxisLab : TYPE, optional DESCRIPTION. The default is None.
OrdinateUnitsLab : TYPE, optional DESCRIPTION. The default is None.
ZAxisDataType : TYPE, optional DESCRIPTION. The default is None.
ZAxisTypeQual : TYPE, optional DESCRIPTION. The default is None.
ZGeneralValue : TYPE, optional DESCRIPTION. The default is None.
ZRPMValue : TYPE, optional DESCRIPTION. The default is None.
ZOrderValue : TYPE, optional DESCRIPTION. The default is None.
ZTimeValue : TYPE, optional DESCRIPTION. The default is None.
UserValue1 : TYPE, optional DESCRIPTION. The default is None.
UserValue2 : TYPE, optional DESCRIPTION. The default is None.
UserValue3 : TYPE, optional DESCRIPTION. The default is None.
UserValue4 : TYPE, optional DESCRIPTION. The default is None.
SamplingType : TYPE, optional DESCRIPTION. The default is None.
WeightingType : TYPE, optional DESCRIPTION. The default is None.
WindowType : TYPE, optional DESCRIPTION. The default is None.
AmplitudeUnits : TYPE, optional DESCRIPTION. The default is None.
Normalization : TYPE, optional DESCRIPTION. The default is None.
OctaveFormat : TYPE, optional DESCRIPTION. The default is None.
OctaveAvgType : TYPE, optional DESCRIPTION. The default is None.
ExpDampingFact : TYPE, optional DESCRIPTION. The default is None.
PulsesPerRev : TYPE, optional DESCRIPTION. The default is None.
MeasurementRun : TYPE, optional DESCRIPTION. The default is None.
LoadCase : TYPE, optional DESCRIPTION. The default is None.
IRIGTime : TYPE, optional DESCRIPTION. The default is None.
Returns¶
data_dict : TYPE DESCRIPTION.
to_imat_struct_array¶
Source: GitHub
def sdynpy.NDDataArray.to_imat_struct_array(self, Version=1, SetRecord=0, CreateDate: datetime.datetime = None, ModifyDate: datetime.datetime = None, OwnerName='', AbscissaDataType=<SpecificDataType.UNKNOWN: 0>, AbscissaTypeQual=<TypeQual.TRANSLATION: 0>, AbscissaAxisLab='', AbscissaUnitsLab='', OrdNumDataType=<SpecificDataType.UNKNOWN: 0>, OrdNumTypeQual=<TypeQual.TRANSLATION: 0>, OrdDenDataType=<SpecificDataType.UNKNOWN: 0>, OrdDenTypeQual=<TypeQual.TRANSLATION: 0>, OrdinateAxisLab='', OrdinateUnitsLab='', ZAxisDataType=<SpecificDataType.UNKNOWN: 0>, ZAxisTypeQual=<TypeQual.TRANSLATION: 0>, ZGeneralValue=0, ZRPMValue=0, ZOrderValue=0, ZTimeValue=0, UserValue1=0, UserValue2=0, UserValue3=0, UserValue4=0, SamplingType='Dynamic', WeightingType='None', WindowType='None', AmplitudeUnits='Unknown', Normalization='Unknown', OctaveFormat=0, OctaveAvgType='None', ExpDampingFact=0, PulsesPerRev=0, MeasurementRun=0, LoadCase=0, IRIGTime='', verbose=False)Creates a Matlab structure that can be read the IMAT toolbox.
This structure can be read by the IMAT toolbox in Matlab to create an imat_fn object. Note this is generally a slower function than to_imat_struct.
Parameters¶
Version : int, optional The version number of the function. The default is 1.
SetRecord : int, optional The set record of the function. The default is 0.
CreateDate : datetime, optional The date that the function was created. The default is Now.
ModifyDate : datetime, optional The date that the function was modified. The default is Now.
OwnerName : str, optional The owner of the dataset. The default is ‘’.
AbscissaDataType : SpecificDataType, optional The type of data associated with the Abscissa of the function. The default is SpecificDataType.UNKNOWN.
AbscissaTypeQual : TypeQual, optional The qualifier associated with the abscissa of the function. The default is TypeQual.TRANSLATION.
AbscissaAxisLab : str, optional String used to label the abscissa axis. The default is ‘’.
AbscissaUnitsLab : str, optional String used to label the units on the abscissa axis. The default is ‘’.
OrdNumDataType : SpecificDataType, optional The type of data associated with the numerator of the ordinate of the function. The default is SpecificDataType.UNKNOWN.
OrdNumTypeQual : TypeQual, optional The qualifier associated with the numerator of the ordinate of the function. The default is TypeQual.TRANSLATION.
OrdDenDataType : SpecificDataType, optional The type of data associated with the denominator of the ordinate of the function. The default is SpecificDataType.UNKNOWN.
OrdDenTypeQual : TypeQual, optional The qualifier associated with the denominator of the ordinate of the function. The default is TypeQual.TRANSLATION.
OrdinateAxisLab : str, optional String used to label the ordinate axis. The default is ‘’.
OrdinateUnitsLab : TYPE, optional String used to label the units on the ordinate axis. The default is ‘’.
ZAxisDataType : TYPE, optional DESCRIPTION. The default is SpecificDataType.UNKNOWN.
ZAxisTypeQual : TYPE, optional DESCRIPTION. The default is TypeQual.TRANSLATION.
ZGeneralValue : TYPE, optional DESCRIPTION. The default is 0.
ZRPMValue : TYPE, optional DESCRIPTION. The default is 0.
ZOrderValue : TYPE, optional DESCRIPTION. The default is 0.
ZTimeValue : TYPE, optional DESCRIPTION. The default is 0.
UserValue1 : TYPE, optional DESCRIPTION. The default is 0.
UserValue2 : TYPE, optional DESCRIPTION. The default is 0.
UserValue3 : TYPE, optional DESCRIPTION. The default is 0.
UserValue4 : TYPE, optional DESCRIPTION. The default is 0.
SamplingType : TYPE, optional DESCRIPTION. The default is ‘Dynamic’.
WeightingType : TYPE, optional DESCRIPTION. The default is ‘None’.
WindowType : TYPE, optional DESCRIPTION. The default is ‘None’.
AmplitudeUnits : TYPE, optional DESCRIPTION. The default is ‘Unknown’.
Normalization : TYPE, optional DESCRIPTION. The default is ‘Unknown’.
OctaveFormat : TYPE, optional DESCRIPTION. The default is 0.
OctaveAvgType : TYPE, optional DESCRIPTION. The default is ‘None’.
ExpDampingFact : TYPE, optional DESCRIPTION. The default is 0.
PulsesPerRev : TYPE, optional DESCRIPTION. The default is 0.
MeasurementRun : TYPE, optional DESCRIPTION. The default is 0.
LoadCase : TYPE, optional DESCRIPTION. The default is 0.
IRIGTime : TYPE, optional DESCRIPTION. The default is ‘’.
verbose : TYPE, optional DESCRIPTION. The default is False.
Returns¶
output_struct : np.ndarray A numpy structured array that can be saved to a mat file using scipy.io.savemat.
to_shape_array¶
Source: GitHub
def sdynpy.NDDataArray.to_shape_array(self, abscissa_values=None)Converts an NDDataArray to a ShapeArray
Parameters¶
abscissa_values : ndarray, optional Abscissa values at which the shapes will be created. The default is to create shapes at all abscissa values. If an entry in abscissa_values does not match a value in abscissa, the closest abscissa value will be selected
Returns¶
ShapeArray
ShapeArray containing the NDDataArray’s ordinate as its shape_matrix
Raises¶
ValueError
If the data does not have common abscissa across all functions or if
duplicate response coordinates occur in the NDDataArray
transform_coordinate_system¶
Source: GitHub
def sdynpy.NDDataArray.transform_coordinate_system(self, original_geometry, new_geometry, node_id_map=None, rotations=False)Performs coordinate system transformations on the data
Parameters¶
original_geometry : Geometry The Geometry in which the shapes are currently defined
new_geometry : Geometry The Geometry in which the shapes are desired to be defined
node_id_map : id_map, optional If the original and new geometries do not have common node ids, an id_map can be specified to map the original geometry node ids to new geometry node ids. The default is None, which means no mapping will occur, and the geometries have common id numbers.
rotations : bool, optional If True, also transform rotational degrees of freedom. The default is False.
Returns¶
NDDataArray or Subclass
A NDDataArray that can now be plotted with the new geometry
validate_common_abscissa¶
Source: GitHub
def sdynpy.NDDataArray.validate_common_abscissa(self, **allclose_kwargs)Returns True if all functions have the same abscissa
Parameters¶
**allclose_kwargs : various Arguments to np.allclose to specify tolerances
Returns¶
bool
True if all functions have the same abscissa
zero_pad¶
Source: GitHub
def sdynpy.NDDataArray.zero_pad(self, num_samples=0, update_abscissa=True, left=False, right=True, use_next_fast_len=False)Add zeros to the beginning or end of a signal
Parameters¶
num_samples : int, optional Number of zeros to add to the function. If not specified, no zeros are added unless
use_next_fast_lenisTrueupdate_abscissa : bool, optional If True, modify the abscissa to keep the same abscissa spacing. The function must have equally spaced abscissa for this to work. If False, the added abscissa will have a value of zero. The default is True.
left : bool, optional Add zeros to the left side (beginning) of the function. The default is False. If both
leftandrightare specified, the zeros will be split half on the left and half on the right.right : bool, optional Add zeros to the right side (end) of the function. The default is True. If both
leftandrightare specified, the zeros will be split half on the left and half on the rightuse_next_fast_len : bool, optional If True, potentially add additional zeros to the value specified by
num_samplesto allow the total length of the final signal to reach fast values for FFT as specified byscipy.fft.next_fast_len.
Returns¶
NDDataArray subclass
The zero-padded version of the function