import numpy as np
import dascore as dc
patch = dc.get_example_patch().set_units("m/s")
transformed = patch.dft(dim="time", real=True)
print(transformed.dims)
print(transformed.attrs.data_units)('distance', 'ft_time')
1 m
Transforms change a patch’s domain and usually its dimension names and units. They are available as Patch methods and in dascore.transform.
Patch.dft changes a dimension such as time to its Fourier-domain counterpart, ft_time. real=True keeps only the nonnegative frequencies of real input.
('distance', 'ft_time')
1 m
The transformed coordinate uses inverse units and the data units change according to the transform normalization. Transform several dimensions by naming each one.
CoordRange( min: 0.000 1 / m max: 0.500 1 / m <0.500 1 / m> step: 0.00333 1 / m shape: (151,) dtype: float64 )
Patch.idft performs the inverse transform:
Real transforms remember the information needed for their inverse. Numerical round trips may contain tiny floating-point differences, so compare them with a tolerance rather than exact equality.
See Fourier transforms in DASCore for naming, units, and normalization.
Patch.stft shows frequency content through time; Patch.istft inverts it.

The window length uses the selected coordinate’s units. overlap may be expressed as a percentage, coordinate quantity, or supported numeric form. The inverse uses the transform metadata to reconstruct the original dimension.
Inspect the transformed coordinate to obtain frequency bins; select or filter in the transformed domain exactly as with other patch dimensions.
Like dft, stft drops non-dimensional coordinates associated with the transformed dimension.