Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sdynpy.NDDataArray

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

NameSummary
abscissa_spacingThe spacing of the abscissa in the function. Returns ValueError if abscissa are not evenly spaced.
data_dimensionNumber of dimensions to the data
function_typeReturns the function type of the data array as a FunctionTypes Enum
idx_by_abAbscissaValueExtractor that can be indexed to extract an abscissa range
idx_by_elAbscissaIndexExtractor that can be indexed to extract specific elements
num_coordinatesNumber of coordinates defining the data array
num_elementsNumber of elements in each data array
reference_coordinateCoordinateArray corresponding to the response coordinates
response_coordinateCoordinateArray 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

NameSummary
argmaxReturns the index of the maximum ordinate in the data array
argminReturns the index of the minimum ordinate in the data array
downsampleDownsample a signal by keeping only every n-th abscissa/ordinate pair.
extract_elementsParses elements from the data array specified by the passed indices
extract_elements_by_abscissaExtracts elements with abscissa values within the specified range
from_uffCreate a data array from a unv dictionary from read_unv
from_unvCreate a data array from a unv dictionary from read_unv
get_drive_pointsReturns data arrays where the reference is equal to the response
get_reciprocal_dataGets reciprocal pairs of data from an NDDataArray.
gui_plotCreate a GUIPlot window to visualize data.
interpolateInterpolates the NDDataArray using SciPy’s interp1d.
joinJoins several data arrays together by concatenating their ordinates
loadLoad in the specified file into a SDynPy array object
maxReturns the maximum ordinate in the data array
minReturns the minimum ordinate in the data array
plotPlot the data array
plot_image
reshape_to_matrixReshapes a data array to a matrix with response coordinates along the rows and reference coordinates along the columns
saveSave the array to a numpy file
shape_filterSpatially filters the data using the specified ShapeArray.
to_imat_structCreates a Matlab structure that can be read the IMAT toolbox.
to_imat_struct_arrayCreates a Matlab structure that can be read the IMAT toolbox.
to_shape_arrayConverts an NDDataArray to a ShapeArray
transform_coordinate_systemPerforms coordinate system transformations on the data
validate_common_abscissaReturns True if all functions have the same abscissa
zero_padAdd zeros to the beginning or end of a signal

argmax

def sdynpy.NDDataArray.argmax(self, reduction=None, *argmax_args, **argmax_kwargs)

Returns the index of the maximum ordinate in the data array

Parameters

Returns

argmin

def sdynpy.NDDataArray.argmin(self, reduction=None, *argmin_args, **argmin_kwargs)

Returns the index of the minimum ordinate in the data array

Parameters

Returns

downsample

def sdynpy.NDDataArray.downsample(self, factor)

Downsample a signal by keeping only every n-th abscissa/ordinate pair.

Parameters

Returns

extract_elements

def sdynpy.NDDataArray.extract_elements(self, indices)

Parses elements from the data array specified by the passed indices

Parameters

Returns

extract_elements_by_abscissa

def sdynpy.NDDataArray.extract_elements_by_abscissa(self, min_abscissa, max_abscissa)

Extracts elements with abscissa values within the specified range

Parameters

Returns

from_uff

def sdynpy.NDDataArray.from_uff(unv_data_dict, squeeze=True)

Create a data array from a unv dictionary from read_unv

Parameters

Returns

from_unv

def sdynpy.NDDataArray.from_unv(unv_data_dict, squeeze=True)

Create a data array from a unv dictionary from read_unv

Parameters

Returns

get_drive_points

def sdynpy.NDDataArray.get_drive_points(self, return_indices=False)

Returns data arrays where the reference is equal to the response

Parameters

Returns

Raises

get_reciprocal_data

def sdynpy.NDDataArray.get_reciprocal_data(self, return_indices=False)

Gets reciprocal pairs of data from an NDDataArray.

Parameters

Returns

Raises

gui_plot

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

Returns

interpolate

def sdynpy.NDDataArray.interpolate(self, interpolated_abscissa, kind='linear', **kwargs)

Interpolates the NDDataArray using SciPy’s interp1d.

Parameters

Returns

join

def sdynpy.NDDataArray.join(cls, data_arrays, increment_abscissa=True)

Joins several data arrays together by concatenating their ordinates

Parameters

Returns

load

def sdynpy.NDDataArray.load(cls, filename)

Load in the specified file into a SDynPy array object

Parameters

Returns

Raises

max

def sdynpy.NDDataArray.max(self, reduction=None, *max_args, **max_kwargs)

Returns the maximum ordinate in the data array

Parameters

Returns

min

def sdynpy.NDDataArray.min(self, reduction=None, *min_args, **min_kwargs)

Returns the minimum ordinate in the data array

Parameters

Returns

plot

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

Returns

plot_image

def sdynpy.NDDataArray.plot_image(self, ax=None, reduction_function=None, colorbar_scale='linear', colorbar_min=None, colorbar_max=None)

reshape_to_matrix

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

Returns

save

def sdynpy.NDDataArray.save(self, filename, compress_abscissa=False)

Save the array to a numpy file

Parameters

shape_filter

def sdynpy.NDDataArray.shape_filter(self, shape, filter_responses=True, filter_references=False, rcond=None)

Spatially filters the data using the specified ShapeArray.

Parameters

Returns

Raises

to_imat_struct

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

Returns

to_imat_struct_array

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

Returns

to_shape_array

def sdynpy.NDDataArray.to_shape_array(self, abscissa_values=None)

Converts an NDDataArray to a ShapeArray

Parameters

Returns

Raises

transform_coordinate_system

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

Returns

validate_common_abscissa

def sdynpy.NDDataArray.validate_common_abscissa(self, **allclose_kwargs)

Returns True if all functions have the same abscissa

Parameters

Returns

zero_pad

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

Returns