if pro%narg.eq.0 then
  SAY " "
  SAY "Usage:  @ find-flux-cube Filter Name "
  SAY "        where "
  SAY "     Filter is a filter for the names of Data Cubes to be selected"
  SAY "        (Searched files will be based on 'Filter'"
  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 " "
  SAY "Example:"
  SAY "@ find-flux s-Wide*+C.lmv-clean sed.txt"
  SAY "   will evaluate the flux of for the self-calibrated Wide channels data"
  SAY "   created by the all-widget suite"
  return error
endif
!
sic find &1
if (dir%nfile.eq.0) then
  message E SED "No such file(s) &1"
  return base
endif
!
! Check if SUPPORT exists
if .not.exist(support) then
  message w FLUX "No support defined, using CENTER and SIZE"
  define real edges[4,2] mysize[2]
  if all(size.eq.0) then
    let mysize max(abs(user_xmax),abs(user_ymax))*sec
  else if any(size.eq.0) then
    let mysize size
    let mysize max(mysize[1],mysize[2])
  else
    let mysize size
  endif
  let edges[1] center[1]-mysize[1]/2 center[1]+mysize[1]/2 center[1]+mysize[1]/2 center[1]-mysize[1]/2
  let edges[2] center[2]+mysize[2]/2 center[2]+mysize[2]/2 center[2]-mysize[2]/2 center[2]-mysize[2]/2
  let edges edges*pi/180/3600
  !
  clean\support edges /variable
endif
!
if (pro%narg.eq.2) then
  sic output &2
else
  sic output flux.txt
endif
!
define double freq
define integer k
for fich /in dir%file
  clean\read clean 'fich'
  sic parse 'fich' name
  advanced\flux support
  !
  if (rank(flux%values).eq.1) then
    for i 1 to flux%nc
      say 'flux%frequencies[i]' 'flux%values[i]' 'flux%errors' 'k' " '"'name'"'"
    next
  else 
    for i 1 to flux%nc
      say 'flux%frequencies[i]' 'flux%values[i,1]' 'flux%errors[i,1]' 'k' " '"'name'"'"
    next
  endif
  let k k+1
next
sic output
if (exist(edges)) support /reset
!
