if pro%narg.eq.0 then
  SAY " "
  SAY "Usage:  @ find-pos-uvt FilterName "
  SAY "        where "
  SAY "     Filter is a filter for the names of UV tables to be selected"
  SAY "        (Searched files will be based on 'Filter'.uvt)"
  SAY "     Name is the name of the File that will contain the flux as function of frequency"
  SAY "       (with its extension) (Default flux.txt)"
  SAY " "
  SAY "  The Flux is determined by a simple E_GAUSS fit using UV_FIT"
  SAY " "
  SAY "Example:"
  SAY "@ find-flux-uvt s-Wide*.uvt "
  SAY "   will evaluate the flux of for the self-calibrated Wide channels data"
  SAY "   created by the all-widget suite"
  return error
endif
!
! Step 1: Assume the  UV_FIT files exist
if (NO) then
  sic find &1
  if (dir%nfile.eq.0) then
    message E SED "No such file(s) &1"
    return base
  endif
  !
  for fich /in dir%file
    message I UV_FIT "Treating file "'fich'
    clean\read uv 'fich'
    sic parse 'fich' name
    advanced\uv_fit 'sed%model' /quiet
    clean\write uv_fit 'name'.uvfit
  next
endif
sic find &1.uvfit
!
! Step 2: prepare the output file
define integer k
define double freq
if (pro%narg.eq.2) then
  sic output &2
else
  sic output position.txt
endif
!
for fich /in dir%file
  sic parse 'fich' name
  define image uv_fit 'fich' read
  for i 1 to uv_fit%dim[1]
	if (uv_fit[i,1].ne.0) then
    let freq (i-uv_fit%convert[1,1])*uv_fit%convert[3,1]+uv_fit%convert[2,1]
	  say 'freq' 'uv_fit[i,8]'  'uv_fit[i,9]'  'uv_fit[i,10]' 'uv_fit[i,11]' 'k'  "'"'name'"'" 
	endif
  next
  delete /var uv_fit
  let k k+1
next
sic output
