!
define integer ibe npix
define real bxmax bxmin bymax bymin 
define double chi cpa spa 
!
let ibe = &1
!
bxmin = mira_ymax+0.03*dx
bxmax = mira_xmax
bymin = mira_ymin
bymax = mira_ymax
!
npix = febe'ibe'%header%febefeed
define double xp[npix] yp[npix]
!
xp = febe'ibe'%data%feedoffx*3.6d+3
yp = febe'ibe'%data%feedoffy*3.6d+3
!
if febe'ibe'%header%dewrtmod.ne."EQUA" then
   if febe'ibe'%header%dewrtmod.eq."CABIN" then
      chi  = -data'ibe'%data%elevatio[1]
      chi  = chi+data'ibe'%data%parangle[1]
   else if febe'ibe'%header%dewrtmod.eq."HORIZ" then
      chi = data'ibe'%data%parangle[1]
   else if febe'ibe'%header%dewrtmod.eq."UNDEF" then
      chi = 0.
      say " "
      say "W-PLOT, dewar rotation mode unknown."
      say "W-PLOT, dewar rotation angle set to zero."
      say " "
   endif
   chi = chi*pi/180.
   xp = -febe'ibe'%data%feedoffx*cos(chi)+febe'ibe'%data%feedoffy*sin(chi)
   yp =  febe'ibe'%data%feedoffx*sin(chi)+febe'ibe'%data%feedoffy*cos(chi)
   xp = xp*3600.
   yp = yp*3600.
endif
!
draw relocate -1 1 /box 3
draw arrow -2 1 /box 3
label "\gD\ga " /center 4
draw relocate -1 1 /box 3
draw arrow -1 2 /box 3
draw relocate -1 2.4 /box 3
label "\gD\gd" /center 5 
g\set expand 1.0
!
bymax = bymin+(bxmax-bxmin)
bxmin = bxmin-1.5
bxmax = bxmax-1.5
bymin = bymin-1.5
bymax = bymax-1.5
g\set box bxmin bxmax bymin bymax
limits 67 -67 -67 67 
!
for i 1 to npix
    draw relocate xp[i] yp[i] /user
    ellipse 6 6 0 
    label 'i' chi /center 5 
next
!
