if (.not.exist(fields)) return
if (fields%n.eq.0) return
!
gtvl\clear
define integer nf
let nf abs(fields%n)
define real xoff[nf] yoff[nf] inum[nf] semi
let xoff fields%offsets[1,]
let yoff fields%offsets[2,]
let inum[i] i
let semi fields%primary/2
greg1\limits /VAR xoff yoff
greg1\limits user_xmax+semi user_xmin-semi user_ymin-semi user_ymax+semi
greg1\set box match
greg1\box /unit sec
greg2\ellipse semi  /user xoff yoff
!
if (exist(fields%n_select)) then
  ! Highligh in Red the selected fields
  greg1\pencil 1 /we 2
  define integer i
  for j 1 to fields%n_select
    let i fields%selected[j]
    greg2\ellipse fields%primary/2 /user 'fields%offsets[1,i]' 'fields%offsets[2,i]'
  next
  greg1\pencil 0
  greg2\ellipse fields%primary/16 /user xoff yoff /fill 8
  greg1\pencil /we 3
  greg1\draw text xoff yoff inum 5 /user
  greg1\pencil 1 /we 4
  for j 1 to fields%n_select
    let i fields%selected[j]
    greg1\draw text 'fields%offsets[1,i]' 'fields%offsets[2,i]' 'i' 5 /user
  next
  greg1\pencil 0 /we 3
  delete /var i
else
  !
  ! Overlay the field numbers at center
  greg2\ellipse fields%primary/16 /user xoff yoff /fill 8
  greg1\pencil /we 3
  greg1\draw text xoff yoff inum 5 /user
endif
! for i 1 to fields%n
!  ellipse fields%primary /user 'fields%offsets[1,i]' 'fields%offsets[2,i]'
!next
greg1\label "R.A. Offset (`)" /X
greg1\label "Dec. Offset (`)" /Y
greg1\pencil /we 1
!
