vbeam.core.wave_data#
A datastructure for data related to a transmitted wave.
The most important field of WaveData is source, which represents the
focal point of the transmitted wave. A transmitted wave is usually one of three types:
A focused wave, where the focal point is in front of the transducer.
A diverging wave, where the focal point is behind the transducer.
A plane wave, which is a wave that is “focused” at infinity. In this case, the
sourcefield is eithernp.inf(infinity) orNone.
- class vbeam.core.wave_data.WaveData(*args, **kwargs)[source]#
A vectorizable container of wave data: anything that is specific to a single transmitted wave. See this class’ fields for what that could be.
WaveData is vectorizable, meaning that it works with vmap. This way we can represent the wave data for all transmitted waves in a single object.
If a WaveData object contains multiple transmitted waves then each field will have an additional dimension. For example, source may have the shape (64, 3) if there are 64 transmitted waves in the dataset (each with x, y, and z source coordinates).
- with_updates_to(*, source: ~typing.Callable[[~numpy.ndarray], ~numpy.ndarray] = <function <lambda>>, azimuth: ~typing.Callable[[float], float] = <function <lambda>>, elevation: ~typing.Callable[[float], float] = <function <lambda>>, t0: ~typing.Callable[[float], float] = <function <lambda>>) WaveData[source]#
Return a copy with updated values for the given fields.
If the given value for a field is a function the updated field will be that function applied to the current field. Example: >>> wave_data = WaveData(np.array([0, 0, 0])) >>> wave_data.with_updates_to(source=lambda x: x+1) WaveData(source=array([1, 1, 1]), azimuth=None, elevation=None, t0=None)
If the given value for a field is not a function then the field will simply be set to that value. Example: >>> wave_data.with_updates_to(azimuth=1) WaveData(source=array([0, 0, 0]), azimuth=1, elevation=None, t0=None)