truncate_value

lsst.ts.mtmount.truncate_value(value, min_value, max_value, descr)

Truncate a value, if necessary.

Returns:
A tuple:
  • truncated_value: one of value, min_value, or max_value, as appropriate.
  • message in format f”{descr} from {value:0.2f} to {truncated_value:0.2f}”

    or “” if the value is not truncated.

Raises:
ValueError

If min_value >= max_value.