#!/bin/bash

# makes a summary line from a photometric file

for F in $1
 do 
  S=${F/*\.}
  G=${F/\.*}
#  echo $S
  E='non-photometric'
  if [[ $S == eld || $S == ldt || $S == LDT || $S == ELD ]] 
  then 
   EM='-eicurr_lum.ies'
   E='-ei'
   O='curr_lum.ldt'
  else
   if [[ $S == ies || $S == IES ]]
   then 
    EM='-emcurr_lum.ldt' 
    E='' 
    O='curr_lum.ies'
   fi    
  fi 
  if [[ $E != 'non-photometric' ]]
  then
   URL=`echo $1 | sed -n '/tp:\/\//p'`
   if [[ $URL != '' ]]
   then 
     F=${F/*\/}
     wget -O $O $URL
     G=${F/\.*}
   else
     O=
   fi  
   /home/jhollan/bin/ies2tab $E $@ $O
  else
    echo "$1 Seems to be a $E file" 
  fi
 done 

