FUNCTION PZT2SOLAR, PZTA, PZTB, PZTC, HOME=HOME, ABC2X=ABC2X, ABC2Z=ABC2Z
; Returns X & Z offsets (arcsec) of TRACE FOV from home position
; Add these to normal coordinates for center of CCD
; Inputs are PZT offsets for A, B & C:
;    Units are Edwards' numbers, which are linearly spaced in
;    increasing order:  127, 126...1, 0, 255, 254...129, 128
;
;  TDT  17-Mar-98 -- Dummy calibration data to start with
;  TDT  22-Mar-98 -- Handle vector input, real calib. data
;  TDT  21-Jun-98 -- Good calibration of 19-Jun; signs checked
;  Note Z is North/South & X is East/West

; Calibration data from PZT_CAL run of 19-Jun-98
IF (NOT KEYWORD_SET(HOME)) THEN HOME = [254, 255, 255]
IF (NOT KEYWORD_SET(abc2x)) THEN abc2x = [0., -.0550, +.0609]
IF (NOT KEYWORD_SET(abc2z)) THEN abc2z = [.0585, -.0332, -.0348]

b128 = byte(128)
fhome = float(not(byte(home) xor b128))
offa  = float(not(byte(pzta) xor b128)) - fhome(0)
offb  = float(not(byte(pztb) xor b128)) - fhome(1)
offc  = float(not(byte(pztc) xor b128)) - fhome(2)
x = abc2x(0)*offa + abc2x(1)*offb + abc2x(2)*offc
z = abc2z(0)*offa + abc2z(1)*offb + abc2z(2)*offc
RETURN,[[x],[z]]
END
