bit_truncate_max_complex#

caput.util.truncate.bit_truncate_max_complex(val: numpy.ndarray[numpy.complex128], prec: numpy.float32, prec_max_row: numpy.float32) numpy.ndarray[numpy.complex128][source]#

Truncate using a relative per-element and per the maximum of the last dimension.

This scheme allows elements to be truncated based on their own value and a measure of their relative importance compared to other elements. In practice, the per-element absolute precision for an element val[i, j] is given by max(prec * val[i, j], prec_max_dim * val[i].max()).

Parameters:
valcomplex array_like

The array of values to truncate the precision of. These values are modified in place.

precfloat

The fractional precision on each element.

prec_max_rowfloat

The precision to use relative to the maximum of the of each row.

Returns:
truncatedcomplex array_like

The modified array. This shares the same underlying memory as the input.