let name &1
read uv 'name'
define real allw
compute allw sum uv[10,]
let allw 1E-3/sqrt(allw)
exa allw
uv_map
let fres 0
let niter 0
let ares allw*&2
!
hogbom /flux 0 1000*allw
write cct 'name'
!
begin data gag_scratch:uv_ccmodel.tmp
!
! UV_CCMODEL:
! 	Use a Clean Component Table produced by WRITE CCT
!	to compute a UV table from an input UV coverage
!
TASK\CHARACTER "Input UV coverage" UVSAMPLE$ 'name'
TASK\CHARACTER "Input CLEAN Component Table" CLEAN$ 'name'
TASK\CHARACTER "Output UV table" UVMODEL$ 'name'-cc
TASK\CHARACTER "Frequency" FREQUENCY$ "0"
TASK\LOGICAL "Subtract Clean Components" SUBTRACT$ NO
TASK\GO
end data
!
begin data gag_scratch:uv_fcct.tmp
TASK\FILE "Input UV Sample Table" UVSAMPLE$ 'name'
TASK\FILE "Input .LMV Cube "      IMAGE$  'name'.cct
TASK\FILE "Output UV Model Table" UVMODEL$ 'name'-cc 
TASK\REAL "UV Model Table frequency" FREQUENCY$ 0
TASK\LOGICAL "Accurate (YES) or rough (NO) precision" LARGE$ NO
TASK\GO
end data
!
!
!! run uv_ccmodel gag_scratch:uv_ccmodel.tmp /nowin
run uv_fcct gag_scratch:uv_fcct.tmp /nowin
!
@ fit_flux 'name' 'name'-cc
flux list
delete /var myflux



