#!/bin/bash

# This version by Kurt Schwehr.
# Adapted from that by JCHill and JPWalsh Jun/Jul2003

if [ $# != 2 ]; then
  echo "must specify input and output files:"
  echo
  echo "  $0 line.xstar line.sgy"
  exit
fi

infile=$1
outfile=$2
#outfile=${1%%.xstar}.sgy

# FIX: detect if we need to byte swap the data...
# is this possible to do?

sioseis << EOF
procs diskin xstar header diskoa end
diskin
   format edgetech
   ipath ${infile} end
end
xstar
   end
end
filter
  ftype 1 pass 500 dbdrop 1000 end
end
header
     fno 0 lno 999999 ftr 0 ltr 99999
     l2 = l1 end
end
diskoa
  ofmt 1 opath ${outfile} end
end
end
EOF

