;Name:
;       lt_offset.pro
;
;Purpose:
;       To generate the new x offset and y offset for
;       fine tuning adjustments according to the most recent
;	monitor_center outputs.
;
;Inputs:
;	xvalue - current x value from monitor_center
;	yvalue - current y value from monitor_center
;	xoffs - current x offset from limb tracker page
;	yoffs - current y offset from limb tracker page
;
;History:
;       Written 5-April-2000 by S. E. Gregory 
;Comments:
;	10-Apr-00 (SEG) - Just added prompt lines so the user can enter in the data one by one.
;

pro lt_offset

xvalue = ''
read, xvalue, prompt='Please enter the x value of the most recent monitor_center output: '

yvalue = ''
read, yvalue, prompt='Please enter the y value of the most recent monitor_center output: '

xoffs = ''
read, xoffs, prompt='Please enter the current x offset from the limb tracker page: '

yoffs = ''
read, yoffs, prompt='Please enter the current y offset from the limb tracker page: '

xorg = xoffs
yorg = yoffs

xcorr = 511.5 - xvalue
ycorr = 511.0 - yvalue

print, 'x correction =', xcorr, '   y correction =', ycorr

n = round(2.5*xcorr)
m = round(-2.5*ycorr)

newxoffs = xorg + m
newyoffs = yorg + n

print, ''
print, 'The tcblock commands to use to make the fine tuning adjustments are:

print, 'tcblock mbltxofs', newxoffs
print, 'tcblock mbltyofs', newyoffs

end


