#!/bin/bash set -ue TMPFILE="/dev/shm/plot-timing.tmp" IMAGE="timing.png" echo ; figlet "plot timing" ; echo wc WS/mp4.timing | tee -a WS/log if [ $# == 1 ] then sequence=$1 else sequence="escadrille" fi grep $sequence WS/mp4.timing | tail -3600 | awk ' \ BEGIN { \ nbrames=360; \ for (foo=0; foo $3) mini[$2] = $3; \ if (maxi[$2] < $3) maxi[$2] = $3; \ } \ \ END { \ for (foo=0; foo 0) { \ mean = accu[foo] / count[foo]; \ printf "%4d %4f %4d %4d\n", foo, mean, \ mini[foo], maxi[foo]; \ } \ } \ } \ ' > $TMPFILE # cat -n $TMPFILE | tail # ; exit gnuplot << __EOC__ set term png size 1024,768 set output "timing.png" set grid set xrange [:360] set yrange [0:] set title "Séquence '${sequence}'" set xlabel "numéro de la trame" set ylabel "temps en secondes" plot "/dev/shm/plot-timing.tmp" u 1:4 w l lc "#ff0000" t "maximum", \ "/dev/shm/plot-timing.tmp" u 1:3 w l lc "#0000ff" t "minimum", \ "/dev/shm/plot-timing.tmp" u 1:2 w l lc "#000000" t "moyenne", __EOC__ convert -negate -colorspace gray -level -33% $IMAGE WS/negatif.png