fourierror.numerical#
Monte Carlo propagation of uncertainty through the discrete Fourier transform.
Samples are drawn from a multivariate normal distribution described by the input values and covariance, each sample is transformed, and the mean and covariance of the transformed samples are returned.
- fourierror.numerical.dft(data, coord, n_samples=5000, random_state=None, diag_tol=1e-12)#
Perform a numerical discrete Fourier transform.
- Parameters:
data (
DataArray) – A one-dimensional scipp DataArray with variances, holding the data to be Fourier transformed. Its variances are taken as uncorrelated, unless it is aCovDataArray, whose full covariance is used.coord (
str) – The coordinate to compute the Fourier transform over. It must be evenly spaced; aTypeErroris raised otherwise.n_samples (
int) – Number of samples to use to obtain numerical solution. Optional, defaults to 5000.random_state (
None|int|Generator) – Seed or generator passed to the random sampler, to enable reproducibility. Optional, defaults toNone.diag_tol (
float) – Tolerance used to decide if the output covariance matrices are diagonal. Optional, defaults to 1e-12.
- Raises:
ValueError – If
datais not one-dimensional, has no variances and is not aCovDataArray, orcoordis not a coordinate along the dimension ofdata.- Return type:
- Returns:
A scipp DataGroup with
realandimagentries holding the sample mean and covariance of(2 / n) * numpy.fft.fftof the samples, on anomegaaxis of angular frequencies (seefrequencies()). Each entry is aCovDataArrayif its covariance is not diagonal, otherwise a plainscipp.DataArray.
- fourierror.numerical.fft(data, coord, n_samples=5000, random_state=None, diag_tol=1e-12)#
Perform a numerical fast Fourier transform.
- Parameters:
data (
DataArray) – A one-dimensional scipp DataArray with variances, holding the data to be Fourier transformed. Its variances are taken as uncorrelated, unless it is aCovDataArray, whose full covariance is used.coord (
str) – The coordinate to compute the fast Fourier transform over. It must be evenly spaced; aTypeErroris raised otherwise.n_samples (
int) – Number of samples to use to obtain numerical solution. Optional, defaults to 5000.random_state (
None|int|Generator) – Seed or generator passed to the random sampler, to enable reproducibility. Optional, defaults toNone.diag_tol (
float) – Tolerance used to decide if the output covariance matrices are diagonal. Optional, defaults to 1e-12.
- Raises:
ValueError – If
datais not one-dimensional, has no variances and is not aCovDataArray, orcoordis not a coordinate along the dimension ofdata.- Return type:
- Returns:
A scipp DataGroup with
realandimagentries holding the sample mean and covariance of(2 / n) * numpy.fft.fftof the samples, on anomegaaxis of angular frequencies (seefrequencies()). Each entry is aCovDataArrayif its covariance is not diagonal, otherwise a plainscipp.DataArray.