#!/bin/bash

declare -ar names=( fluidized undisturbed shearfrac minimaldef )

for name in "${names[@]}"; do
    echo $name
    grep -i triaxial ${name}.dat > ${name}-tri.dat
    grep -i oblate   ${name}.dat > ${name}-obl.dat

    awk '{print $7}' ${name}-tri.dat > ${name}-tri.v3inc
    awk '{print $7}' ${name}-obl.dat > ${name}-obl.v3inc

    ../makeHistogramTable.py ${name}-tri.v3inc 0 90 18 > ${name}-tri-v3inc.tab
    ../makeHistogramTable.py ${name}-obl.v3inc 0 90 18 > ${name}-obl-v3inc.tab
done

#
# Now make CDF data files
#

for file in *.v3inc; do
    ../makeCDF.py $file > ${file}.cdf
done
