function bcs_point,wbin,channel=channel,arcsec=arcsec,lat=lat,date=date
;+
; NAME:
;	BCS_POINT
; PURPOSE:
;	Derives a solar N-S position from bin no. of BCS resonance line
; CALLING SEQUENCE:  
;	pos = bcs_point(wbin,chan [,/arcsec])
; INPUTS:
;	wbin	  bin number of resonance line
; OPTIONAL INPUTS:
;	chan=chan channel associated with wbin  [def = 3]
;	/arcsec	  if specified, pos reruned in arcsecs [def = arcmins]
;	date=date string containing date to be used for heliocentric 
;		  angle determination
; OUTPUTS:
;	pos	  N-S position in arcmins  (North is +ve)
; OPTIONAL OUTPUTS:
;	lat=lat	  if present, returns average heliocentric latitude
;		  NOTE: needs date to de supplied.
; RESTRICTIONS:
;
; PROCEDURE:
;	Uses file derived by determining the position of the resonance 
;	lines from SXT for a large number of flares.
;	If date supplied, average latitude that is equivalent to this
;	N-S offset for the supplied epoch is calculated.
;	Reference file is  $DIR_BCS_CAL/bcs_pointing.dat
; MODIFICATION HISTORY:
;	RDB  04-Mar-93
;	RDB  10-Mar-93	Made channel 3 default; introduced chan parameter
;	RDB  13-Mar-93  Changed $DIR_BCS_CALDAT to $DIR_BCS_CAL
;-

openr,lunf,concat_dir('$DIR_BCS_CAL','bcs_pointing.dat'),/get_lun

ss=''
readf,lunf,ss 		;& print,ss
readf,lunf,ss 		;& print,ss
readf,lunf,ss 		;& print,ss

cc  = fltarr(2)
ccval = fltarr(2,4)
wav=''
for j=0,2 do begin
  readf,lunf,wav,cc,nsamp,format='(a,t10,2f12.6,i7)'
;  print,cc,nsamp
  ccval(*,3-j) =  cc
endfor

;	default to channel 3 (Ca XIX) unless told otherwise
chan = 3
if keyword_set(channel) then chan = channel

;	calculate expected solar position
pos = ccval(0,chan-1) + wbin*ccval(1,chan-1)

;	if date supplied, calculate heliocentric latitude
;	determine average by doing it in 1 arcmin E_W steps
if keyword_set(date) then begin
  lats = fltarr(16)
  epoch = date
  for j= 0,15 do begin
    g = arcmin2hel(j,pos,date=epoch)
    lats(j) = g(0)
  endfor
  lat = total(lats)/16.
  print,'Calculated position on: ',date,lat
endif

if keyword_set(arcsec) then pos = pos*60.	;arc secs

return,pos
end
