format_chiller_command_value

lsst.ts.atwhitelight.format_chiller_command_value(value, scale, nchar, signed)

Format a value as the string needed for a chiller command.

Parameters:
valuefloat

Value to be formatted

scalefloat

The amount by which to multiply the value before formatting as a string with no decimal point:

  • 10: temperature (C) and flow rate (liters per minute)

  • 1000: TEC current (amps)

ncharint

The number of characters in the string.

signedboolean

Should the value include a leading sign? If false then negative values are rejected.

Returns:
formatted_valuestr

Formatted value; a 5 character string {sign}{dddd}, where:

  • sign is “+” or “-”

  • dddd is abs(value) * scale rounded to the nearest integer

For example:

  • value=1.29, scale=10 is formatted as “+0013”

  • value=-0.2012, scale=1000 is formatted as “-0201”