#!/bin/sh

#matchsticks output from sunsort
#usage mstick < go.raw > go.cal

#sets gains relative to adc1 for first 264 channels
#sets rest relative to adc265

awk '\
     /adc265/ {i = 0} \
     /^Peak/ {printf "%s", substr($6, 4, 3)} \
     /^Slope/ { if (i==0) i=$3; printf " %s ", i/$3} \
     /^Intercept/ {print $3}'
