differt.em.lengths_to_delays#
- lengths_to_delays(lengths, speed=299792458.0)[source]#
Compute the delay, in seconds, corresponding to each length.
- Parameters:
lengths (
Float[ArrayLike, '*#batch']) – The array of lengths (in meters).speed (
Float[ArrayLike, '*#batch']) – The speed (in meters per second) used to compute the delay. This can be an array of speeds. Default is the speed of light in vacuum.
- Return type:
- Returns:
The array of path delays.
Examples
The following example shows how to compute a delay from a length.
>>> from differt.em import c >>> from differt.em import ( ... lengths_to_delays, ... ) >>> >>> lengths = jnp.array([1.0, 2.0, 4.0]) >>> lengths_to_delays(lengths) * c Array([1., 2., 4.], dtype=float32) >>> lengths_to_delays(lengths, speed=2.0) Array([0.5, 1. , 2. ], dtype=float32)