
pro eis_three_pointing,ipf=ipf

  MIN_DURATION = 71.*60. ;; raster duration in seconds
  FOVX = 480.0           ;; fovx in arcsec
  DELTAX = 10.0          ;; safety in x in arcsec
  FOVY = 512.0           ;; fovy in arcsec

  ;; ------------------------------------------------------------------------------------------
  
  if not(keyword_set(ipf)) then ipf = 'eis_three_pointing.dat'
  if not(file_exist(ipf)) then begin
    print,' file does not exist : '+ipf
    return
  endif
  
  src = rd_tfile(ipf,1,/nocomment)
  for i=0,n_elements(src)-1 do begin
    com = src[i]
    res = execute(com)
  endfor

  dt1 = anytim(tim2)-anytim(tim1)
  dt2 = anytim(tim3)-anytim(tim2) 
  if dt2 lt MIN_DURATION or dt1 lt MIN_DURATION then begin
    print,' Error in start times'
    print,' Each raster takes 71 minutes '
    print,' time between 1 and 2 = '+trim(dt1/60.,'(f10.1)')+' m'
    print,' time between 2 and 3 = '+trim(dt2/60.,'(f10.1)')+' m'
    return
  endif

  ;; ------------------------------------------------------------------------------------------

  t = ptrarr(3)
  t[0] = ptr_new(tim1)
  t[1] = ptr_new(tim2)
  t[2] = ptr_new(tim3)

  p = ptrarr(3)
  p[0] = ptr_new(rot_xy(xcen,ycen,tstart=tref,tend=*t[0])+[FOVX-DELTAX,0.0])
  p[1] = ptr_new(rot_xy(xcen,ycen,tstart=tref,tend=*t[1]))
  p[2] = ptr_new(rot_xy(xcen,ycen,tstart=tref,tend=*t[2])-[FOVX-DELTAX,0.0])

  ;; ------------------------------------------------------------------------------------------

  window,xs=800,ys=800
  pos = [0.05,0.05,0.95,0.95]
  !p.position = pos

  this_time = *t[0]
  plot,[-1000,1000],[-1000,1000],/nodata,color=color,/noerase,$
      xtickname=replicate(' ',20),ytickname=replicate(' ',20),$
      title=this_time
  plot_helio,anytim(this_time,/ccsds),/over,/limb

  print,'Start Time','XCEN','YCEN',format='(a20,2a10)'
  for i=0,2 do begin
    time = anytim(*t[i],/yohkoh,/trunc)
    xy   = *p[i]
    print,time,xy[0],xy[1],format='(a20,2f10.2)'

    draw_boxcensiz,xy[0],xy[1],fovx,FOVY,/data
    plots,xy[0],xy[1],psym=1,/data

    s = '('+trim(xy[0],'(f10.1)')+','+trim(xy[1],'(f10.1)')+')'
    xyouts,xy[0],xy[1]-50,s,alignment=0.5,/data,charsize=1.5
    xyouts,xy[0],xy[1]+50,time,alignment=0.5,/data,charsize=1.5
  endfor

return
end
