Ensibs/Systemes/Soluce.md
2020-10-04 15:56:06 +02:00

1.7 KiB

Solution / fichier TSV

  #!/bin/bash
  grep VHW Data/00000012.TSV|cut -d, -f6 > /tmp/vitesse.data
  grep DPT Data/00000012.TSV|cut -d, -f2 > /tmp/profondeur.data
  grep MWV Data/00000012.TSV|cut -d, -f4 > /tmp/vent_apparent.data

  gnuplot -persist <<-EOFMarker
     plot   '/tmp/vitesse.data'       with line
     replot '/tmp/profondeur.data'     with line
     replot '/tmp/vent_apparent.data' with line
     pause 3
     plot   '/tmp/vitesse.data'       smooth bezier with line
     replot '/tmp/profondeur.data'     smooth bezier with line
     replot '/tmp/vent_apparent.data' smooth bezier with line
  EOFMarker

  # sortie du graphique dans un fichier image:
  gnuplot -persist <<-EOFMarker
     set term png
     set output "sortie.png"
     plot '/tmp/vitesse.data' smooth bezier with line, '/tmp/vent_reel.data' smooth bezier with line, '/tmp/vent_apparent.data' smooth bezier with line
  EOFMarker

Solution / fichier CSV

  #!/bin/bash
  gnuplot -persist <<-EOFMarker
     set datafile separator ','
     set key autotitle columnhead
     set style data line
     set angles degrees
     set grid
     set xdata time
     set timefmt '%Y-%m-%d %H:%M:%S'
     set xlabel 'time'
     set xtics rotate by 45 right
     set tics font ",10"
     set format x "%H:%M"
     plot   'Data/00000012.csv' using 1:5
     replot 'Data/00000012.csv' using 1:4
     replot 'Data/00000012.csv' using 1:5  smooth bezier lw 4 title 'sow lissee'
     replot 'Data/00000012.csv' using 1:4  smooth bezier lw 4 title 'depth lissee'
  EOFMarker

Que s'est il passé ?

talonnage :

c2

c3

m2

m3.2

m3