Skip to content

system_settings

system_settings

Global definition of system settings to be imported by sequence constructors.

raster

raster(val: float, precision: float) -> float

Fit value to gradient raster.

Parameters:

  • val (float) –

    Time value to be aligned on the raster.

  • precision (float) –

    Raster precision, e.g. system.grad_raster_time or system.adc_raster_time

Returns:

  • Value wih given time/raster precision –
Source code in src/console/utilities/sequences/system_settings.py
def raster(val: float, precision: float) -> float:
    """Fit value to gradient raster.

    Parameters
    ----------
    val
        Time value to be aligned on the raster.
    precision
        Raster precision, e.g. system.grad_raster_time or system.adc_raster_time

    Returns
    -------
        Value wih given time/raster precision
    """
    # return np.round(val / precision) * precision
    gridded_val = round(val / precision) * precision
    return gridded_val