;+ ; NAME:TMP2BYTE ; ; PURPOSE: ; To return the byte value of a temperature. ; ; CATEGORY: ; ; CALLING SEQUENCE: ; TMP2BYTE(cam,temp) ; ; INPUTS: ; CAM: A one byte INTEGER, specifying the camera number. ; ; TEMP: A SCALAR or ARRAY of temperatures. ; ; KEYWORD PARAMETERS: ; None. ; ; OUTPUTS: ; BYTE: An INTEGER array, containing the byte values ; corresponding to the temperatures passed in ; TEMP. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; None. ; ; PROCEDURE: ; The slope, m, and intercept, b, needed to produce the ; linear transformation from the temperature to its ; byte representation (note the parameters are different ; for camera 0 and 1)is calculated. This transformation ; is then applied to the values in TEMP and returned in ; BYTE. ; ; MODIFICATION HISTORY: ; Written June 1994, by T A Oliynyk. ;- FUNCTION tmp2byte,cam,temp IF cam EQ 0 THEN BEGIN m=255./(45-(-10)) b=255.-45*m ENDIF IF cam EQ 1 THEN BEGIN m=255./(49-(-6)) b=255.-49*m ENDIF byte=temp*m+b byte=ROUND(byte) RETURN, byte END