Patch

class of dascore.io.tdms.core source

Patch(
    data: numpy.__array_like._SupportsArray[numpy.dtype[Any]] | numpy.__nested_sequence._NestedSequence[numpy.__array_like._SupportsArray[numpy.dtype[Any]]] | bool | int | float | <class ’complex | str | <class ’bytes | numpy.__nested_sequence._NestedSequence[bool | int | float | <class ’complex | str | <class ’bytes] ,
    coords: Mapping[str, numpy.__array_like._SupportsArray[numpy.dtype[Any]] | numpy.__nested_sequence._NestedSequence[numpy.__array_like._SupportsArray[numpy.dtype[Any]]] | bool | int | float | <class ’complex | str | <class ’bytes | numpy.__nested_sequence._NestedSequence[bool | int | float | <class ’complex | str | <class ’bytes]] ,
    dims: tuple[str, …] ,
    attrs: PatchAttrs ,
)

A Class for managing data and metadata.

Parameters

Parameter Description
data An array-like containing data, an xarray DataArray object, or a Patch.
coords The coordinates, or dimensional labels for the data. These can be passed in three forms: {coord_name: data} {coord_name: ((dimensions,), data)} {coord_name: (dimensions, data)}
dims A sequence of dimension strings. The first entry cooresponds to the first axis of data, the second to the second dimension, and so on.
attrs Optional attributes (non-coordinate metadata) passed as a dict.
Note

Unless data is a DataArray or Patch, data, coords, and dims are required.

Methods

Name Description
abs Take the absolute value of the patch data.
aggregate Aggregate values along a specified dimension.
assign_coords Add non-dimensional coordinates to a patch.
decimate Decimate a patch along a dimension.
detrend Perform detrending along a given dimension (distance or time) of a patch.
equals Determine if the current trace equals the other trace.
interpolate Set coordinates of patch along a dimension using interpolation.
iresample Resample a patch along a single dimension using Fourier Method.
median_filter Apply 2-D median filter
new Return a copy of the Patch with updated data, coords, dims, or attrs.
normalize Normalize a patch along a specified dimension.
pass_filter Apply a Butterworth pass filter (bandpass, highpass, or lowpass).
pipe Pipe the patch to a function.
rename Rename coordinate or dimensions of Patch.
resample Resample along a single dimension using Fourier Method and interpolation.
select Return a subset of the trace based on query parameters.
sobel_filter Apply a Sobel filter.
squeeze Return a new object with len one dimensions flattened.
standardize Standardize data by removing the mean and scaling to unit variance.
to_xarray Return a data array with patch contents.
transpose Transpose the data array to any dimension order desired.
update_attrs Update attrs and return a new Patch.