sic output selfcal-'self_mode'.last
!
say "let self_mode "'self_mode'
say "let self_sname "'self_sname'
say "!"
say "let self_niter " /format A /noadvance
for i 1 to self_loop
 say " "'self_niter[i]' /noadvance /format A
next
say " /resize ! Niter"
say "let self_times " /format A /noadvance
for i 1 to self_loop
 say " "'self_times[i]' /noadvance /format A
next
say " /resize ! Times"
say "let self_minflux " /format A /noadvance
for i 1 to self_loop
 say " "'self_minflux[i]' /noadvance /format A
next
say " /resize ! Minimum Flux"
say "!" 
say "!" 
say "let self_channel "'self_channel[1]' 'self_channel[2]'
say "let self_flux "'self_flux'
say "let self_refant "'self_refant'
!
say "let self_restore "'self_restore'
say "let self_display "'self_display'
!
say "! Clean parameters "
say "let clean_fres "'clean_fres'
say "let clean_ares "'clean_ares'
say "let clean_niter "'clean_niter'
say "let clean_gain "'clean_gain'
!
say "! UV_MAP parameters "
say "let map_robust "'map_robust'
say "let map_uvtaper "'map_uvtaper[1]' 'map_uvtaper[2]' 'map_uvtaper[3]'
say "let map_uvcell "'map_uvcell'
say "let map_cell "'map_cell[1]' 'map_cell[2]'
say "let map_size "'map_size[1]' 'map_size[2]'
say "let map_field "'map_field[1]' 'map_field[2]'
!
say "! SHOW parameters "
say "let spacing "'spacing[1]'" "'spacing[2]' 
say "let error_bars "'error_bars' 
!
if (exist(support%nxy)) then
  if support%nxy.gt.2 then
    say "if exist(SelfSupport) delete /var SelfSupport"
    say "define structure SelfSupport /global"
    say "define integer SelfSupport%nxy /global"
    let n support%nxy /new integer
    say "define double SelfSupport%y["'n'"] SelfSupport%x["'n'"] /global"
    say "let SelfSupport%nxy "'support%nxy'
    for i 1 to n
      say "let SelfSupport%x["'i'"] "'support%x[i]'
      say "let SelfSupport%y["'i'"] "'support%y[i]'
    next
    say "if .not.exist(support%nxy) then"
    say "  SAY I-SELFCAL,  Recovering support"
    say "  support SelfSupport /variable"
    say "else"
    say "  SAY ""W-SELFCAL,  Support already existing, use  SUPPORT SelfSupport /variable to recover the previous one"""
    say "endif"
  endif
endif
sic output
say "I-SELFCAL,  Saved "'self_mode'" self-calibration parameters"

