quantize_readout_timing#
- pypulseqpp.quantize_readout_timing()[source]#
Choose an ADC dwell from a requested receiver bandwidth.
Receiver bandwidth is the full sampling bandwidth,
1 / dwellin Hz, not bandwidth per pixel.Search upward from the nearest ADC-raster dwell satisfying the duration floor, for at most
MAX_RASTER_SEARCH_STEPScandidates. If none aligns the readout to the gradient raster, return that starting dwell. Inputs must have positive sample count, bandwidth and rasters.- Parameters:
nx_ro (int) – Number of readout samples.
target_bw_hz_px (float) – Requested receiver bandwidth in Hz, i.e.
1 / dwell. The parameter name is kept for compatibility; the value is not a per-pixel bandwidth.grad_raster_s (float) – Gradient and ADC rasters (s).
adc_raster_s (float) – Gradient and ADC rasters (s).
min_flat_time_s (float) – Lower bound on the flat time (s), e.g. from the max-gradient limit.
- Returns:
dwell_s (float) – ADC dwell time (s), a multiple of
adc_raster_s.flat_time_s (float) –
nx_ro * dwell_s(s); gradient-raster alignment is not guaranteed if the search is exhausted.
Examples
>>> from pypulseqpp._timing import quantize_readout_timing >>> dwell, flat = quantize_readout_timing(256, 62_500.0, 1e-5, 1e-7, 0.0) >>> abs(flat / 1e-5 - round(flat / 1e-5)) < 1e-9 True