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:
- value
float
Value to be formatted
- scale
float
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)
- nchar
int
The number of characters in the string.
- signed
boolean
Should the value include a leading sign? If false then negative values are rejected.
- value
- Returns:
- formatted_value
str
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”
- formatted_value