ceil_to_raster

Contents

ceil_to_raster#

pypulseqpp.ceil_to_raster()[source]#

Round seconds up to the next raster multiple, within a 1e-10 relative tolerance.

raster_s is a raster period in seconds. A value already within the tolerance of a raster multiple is not pushed to the next one.

Parameters:
  • value_s (float) – The time to round (s).

  • raster_s (float) – The raster period to round it onto (s).

Returns:

The smallest multiple of raster_s that is not below value_s.

Return type:

float

Examples

>>> import pypulseqpp as pp
>>> round(pp.ceil_to_raster(21e-6, 10e-6), 9)
3e-05
>>> pp.ceil_to_raster(20e-6, 10e-6)
2e-05