xdas.synthetics.wavelet_wavefronts#

xdas.synthetics.wavelet_wavefronts(*, starttime='2023-01-01T00:00:00', resolution=(np.timedelta64(20, 'ms'), 25.0), nchunk=None)[source]#

Generate a synthetic DAS DataArray with wavelet wavefronts.

Parameters:
  • starttime (str, optional) – The starttime of the data, parsed by np.datetime64(starttime). Default is "2023-01-01T00:00:00".

  • resolution ((timedelta64, float), optional) – The temporal and spatial sampling intervals. Default is (np.timedelta64(20, "ms"), 25.0).

  • nchunk (int, optional) – If provided, splits the result into nchunk chunks and returns a list of DataArrays instead of a single DataArray.

Examples

>>> import os
>>> import xdas as xd
>>> from xdas.synthetics import wavelet_wavefronts
>>> from tempfile import TemporaryDirectory
>>> with TemporaryDirectory() as dirpath:
...     wavelet_wavefronts().to_netcdf(os.path.join(dirpath, "sample.nc"))
...     for idx, da in enumerate(wavelet_wavefronts(nchunk=3), start=1):
...         da.to_netcdf(os.path.join(dirpath, f"{idx:03}.nc"))
...     da_monolithic = xd.open(os.path.join(dirpath, "sample.nc"))
...     da_chunked = xd.open(os.path.join(dirpath, "00*.nc"))
...     da_monolithic.equals(da_chunked)
True