!
! X_DO_FIND.ASTRO, CALLED BY X_FIND_CALIB.ASTRO
!
! Check that a source name has been entered
if source_name.eq." " then
  say "E-FIND CALI: please enter a source name"
  return base
endif
catalog gag_data:'catalog_name' /alternate
if do_catalog then
  catalog 'local_catalog' /sou
  source 'source_name'
  frame eq ra|pi*12 dec|pi*180 2*search_radius
  source 'source_name' /draw
else
  if source_ra.eq." ".or.source_dec.eq." " then
    say "E-FIND CALI: please enter source coordinates"
    return base
  endif
  sic out gag_tmp:1.sou
  say 'source_name' 'source_system' 'source_epoch' 'source_ra' 'source_dec'
  sic out
  catalog gag_tmp:1.sou
  source 'source_name'
  frame eq ra|pi*12 dec|pi*180 2*search_radius
  source 'source_name' /draw
endif
!
greg1\set char 0.4
pencil 8 /col 15
source /draw f /alternate /flux 'flux_lim[1]'  'flux_lim[2]'
greg1\set char 0.5
pencil 1
source /draw f /alternate /flux 'flux_lim[2]'  'flux_lim[3]'
pencil 3
greg1\set char 0.6
source /draw f /alternate /flux 'flux_lim[3]'   50
pencil 0
!
draw text  -8 -1 "Source: "'source_name' 6 /box 7
draw text -8 -2 "Search radius: "'search_radius'" deg." 6 /box 7
!! draw text -8 -3 "Calibrators:" 6 /box 7
!! pen 8 /col 15
!! draw text -7.5 -3.75 "Fluxes 0.1 - 0.6" 6 /box 7
!! pen 1
!! draw text -7.5 -4.5 "Fluxes 0.6 - 2.0" 6 /box 7
!! pen 3
!! draw text -7.5 -5.25 "Fluxes > 2.0" 6 /box 7
pen 0
