sample_wave

Contents

sample_wave#

pulserver.ir.sample_wave()[source]#

Return a wave as a playout loads it into a region, normalised to unit peak.

wave is the subsequence and the wave’s index there, as play() reports it, and region one that plan_waves() lays out. The wave is sampled at the centres of the region’s samples raster intervals from its start_us, linear between the points play() plays it through and zero outside them.

Parameters:
  • seq_path (Path | str) – The first file of the chain; the cache is the file beside it.

  • wave (tuple[int, int]) – (subsequence, index).

  • region (dict[str, Any]) – One region of the layout plan_waves() returns.

  • budget (WaveBudget) – The budget the layout was planned for; its raster_us is the sampling interval.

  • cache_ext (str, default='.pseg') – Extension of the cache, dot included.

Returns:

(3, samples), along x, y and z; zero on an axis the wave does not drive.

Return type:

ndarray

Raises:

ValueError – If the cache cannot be loaded or holds no such wave.