# prend un des fichiers time serie ($1),
# et sort : time,delta ou delta est la difference par rapport a la premiere valeur
# pour toutes les colonnes


file=$1

val2=`head -1 $file |awk '{print $2}'`
val3=`head -1 $file |awk '{print $3}'`
val4=`head -1 $file |awk '{print $4}'`
val5=`head -1 $file |awk '{print $5}'`
val6=`head -1 $file |awk '{print $6}'`
val7=`head -1 $file |awk '{print $7}'`
val8=`head -1 $file |awk '{print $8}'`
val9=`head -1 $file |awk '{print $9}'`
val10=`head -1 $file |awk '{print $10}'`
val11=`head -1 $file |awk '{print $11}'`
val12=`head -1 $file |awk '{print $12}'`
val13=`head -1 $file |awk '{print $13}'`
val14=`head -1 $file |awk '{print $14}'`
val15=`head -1 $file |awk '{print $15}'`
val16=`head -1 $file |awk '{print $16}'`

awk -v var2=$val2  -v var3=$val3  -v var4=$val4  -v var5=$val5  -v var6=$val6  -v var7=$val7 -v var8=$val8 -v var9=$val9  -v var10=$val10  -v var11=$val11 -v var12=$val12 -v var13=$val13 -v var14=$val14 -v var15=$val15 -v var16=$val16 '{print $1,$2-var2,$3-var3,$4-var4,$5-var5,$6-var6,$7-var7,$8-var8,$9-var9,$10-var10,$11-var11,$12-var12,$13-var13,$14-var14,$15-var15,$16-var16}' $file > delta-var.dat