pro bsv2arcsec,n
;+
; NAME:
;	BSV2ARCSEC
;
; PURPOSE:
;	This procedure generates a file giving the conversion of the 
;	boresighter and PES from volts to arc seconds.
;
; CATEGORY:
;	LASCO PACKETS
;
; CALLING SEQUENCE:
;	BSV2ARCSEC
;
; INPUTS:
;	None
;
; OUTPUTS:
;	This procedure generates a file,  in the current directory, containing
;	the conversion of the BS and PES for each DN to voltages and to arc 
;	seconds.  It also generates 4 plots on the screen of the BS-X, BS-Y,
;	PES-X and the PES-Y.
;
; MODIFICATION HISTORY:
; 	Written by:	RA Howard, NRL, 16 Mar 1996
;
;
;	@(#)bsv2arcsec.pro	1.2 09/22/96 LASCO IDL LIBRARY
;-
;
dn=findgen(256)
v=1.5*(dn-128)*0.0782		; conversion of BS/PES DN to volts
bs_x = 0.9091*(dn-126)		; conversion of BS-X DN to arc sec
bs_y = 1.0000*(dn-185)		; conversion of BS-Y DN to arc sec
pes_x = 2.*(dn-104)		; conversion of PES-X DN to arc sec
pes_y = 2.*(dn-129)		; conversion of PES-Y DN to arc sec
!x.title='Voltage'
!y.title='Arc Sec'
plot,v,bs_x,title='BORESIGHTER - X',xrange=[-5,+5]
openw,lu,'bspes_conv.lst',/get_lun
printf,lu,'                    BS-X'
printf,lu,'      Voltage      Arc Sec'
for i=100,150 do printf,lu,v(i),bs_x(i)
plot,v,bs_y,title='BORESIGHTER - Y',xrange=[5.5,+7.5]
printf,lu
printf,lu
printf,lu,'                    BS-Y'
printf,lu,'      Voltage      Arc Sec'
for i=150,200 do printf,lu,v(i),bs_y(i)
for i=150,200 do print,v(i),bs_y(i)
plot,v,pes_x,title='PES - X'
printf,lu
printf,lu
printf,lu,'             PES-X'
printf,lu,'      Voltage      Arc Sec'
for i=150,200 do printf,lu,v(i),pes_x(i)
for i=150,200 do print,v(i),pes_x(i)
plot,v,pes_y,title='PES - Y'
printf,lu
printf,lu
printf,lu,'             PES-Y'
printf,lu,'      Voltage      Arc Sec'
for i=150,200 do printf,lu,v(i),pes_y(i)
for i=150,200 do print,v(i),pes_y(i)
close,lu
free_lun,lu
return
end
