ON-LINE QC
⚠ (:toc:)
<:vspace>
We consider implementing these online QC features. The QC will run on a separate laptop, under Linux OS OpenSuse 11.2.
<:vspace>
!Seismics
----
<:vspace>
* Energy of all 96 traces, in 20 seconds time sections, indicating noise level.
* Frequency content of all 96 traces, over 20 second time secions, indicating defective geophones.
<:vspace>
We will use Seismic Unix to process and plot data.
<:vspace>
As an example, here's a similar plot from NORSAR Åknes land slide hazard surveillance site, showing signal amplityde in 8 ea 3-component geophones as a function of time:
<:vspace>
Attach:current.jpg<br />''Example plot from [[http://www.norsar.no/pc-47-48-Latest-Data.aspx | NORSAR Åknes web page.]]''
<:vspace>
<:vspace>
<:vspace>
!GPS Quality, while in Continuous Recording (CR) mode
----
<:vspace>
In CR mode the Geode recording system gathers blocks of data; the recording of each block has a certain duration - let's say 20 seconds. So the recording systems need an external trigger at an interval rate that is exactly equal to block recording duration. The external trigger signal is provided by the Time Trigger Unit.
<:vspace>
The Time Trigger Unit contains en embedded GPS that outputs different NMEA telegrams in addition to Pulse-per-second signal. For QC purposes, the Time Trigger outputs some of these telegrams on a dedicated serial line that should be connected to the online QC PC.
<:vspace>
In the prototype software we captured serial NMEA telegrams directly from GPS by simply writing ('''/dev/ttyS0''' is equivalent to COM_1):
<:vspace>
%box%<pre class='escaped'>
cat /dev/ttyS0 | tee gps-logfile-7jan2010.txt
</pre>
<:vspace>
The GPS only sent the GPGGA telegram.
<:vspace>
Some lines from this logfile:
<:vspace>
$GPGGA,153510,6023.0658,N,00519.7803,E,1,04,5.3,40.2,M,43.9,M,,*76
$GPGGA,153511,6023.0657,N,00519.7805,E,1,04,5.3,40.4,M,43.9,M,,*78
$GPGGA,153512,6023.0656,N,00519.7807,E,1,04,5.3,40.6,M,43.9,M,,*7A
$GPGGA,153513,6023.0655,N,00519.7809,E,1,04,5.3,40.8,M,43.9,M,,*78
$GPGGA,153514,6023.0654,N,00519.7810,E,1,04,5.3,40.8,M,43.9,M,,*76
<:vspace>
<:vspace>
<:vspace>
<:vspace>
<:vspace>
!!Plot example
Attach:gps-log.png"Example plot of online GPS QC"<br />''Example plot of online GPS QC''
<:vspace>
<:vspace>
<:vspace>
<:vspace>
<:vspace>
!!Extracting and plotting data
Data is extracted every 5 seconds, while graphics plot will be produced every 10 seconds. The following is from prototype software; production version will be slightly different.
<:vspace>
We extraxt relevant data fields from NMEA telegram; in this case from the %newwin%[[http://aprs.gids.nl/nmea/#gga | GPGGA]] sentence, example:
<:vspace>
'''$GPGGA,%red%153514%%,6023.0654,N,00519.7810,E,%red%1%%,%red%04%%,%red%5.3%%,40.8,M,43.9,M,,*76'''
<:vspace>
<:vspace>
We want to extract fields that are marked; they provide information on:
<:vspace>
Field #2: %red%153514%% = Time [UTC]
Field #7: %red%1%% = Valid 3D fix
Field #8: %red%04%% = Number of Satellites
Field #9: %red%5.3%% = %newwin%[[http://en.wikipedia.org/wiki/Dilution_of_precision_(GPS) | Horizontal Dilution of Precision (HDOP)]]
<:vspace>
This is accomplished by the awk command below.
<:vspace>
%box%<pre class='escaped'>
#!/bin/bash
COUNTER=0
#--- Launch process that will display QC plot every 10 seconds.
display -update 10 gps-log.png &
#---- Loop eternally
while [ 1 ]; do
echo The counter is $COUNTER
let COUNTER=COUNTER+1
# First collect last 7200 lines of data from specified GPS log file.
# Then extract certain fields from GPGGA NMEA telegrams (field are comma separated, thus -F','),
# and dump these fields to file.
tail --lines=7200 gps-logfile-7jan2010.txt | awk -F',' '/GPGGA/ {print $2, $7, $8, $9}' > gps.dat
# Generate new data plot using GnuPlot; commands are placed in file gps-plot.gp
gnuplot gps-plot.gp
sleep 5
done
#---- while [ $COUNTER -lt 10 ]; do
</pre>
<:vspace>
<:vspace>
!!GNUPLOT script
%box%<pre class='escaped'>
set terminal png size 1000,600
set output "gps-log.png"
set xdata time
set timefmt "%H %M %S"
set format x "%H:%M:%S"
# time range must be in same format as data file
#set xrange ["Mar-25-00:00:00":"Mar-26-00:00:00"]
set yrange [0:10]
set grid
set xlabel "Time [UTC]"
set ylabel "GPS No. of sats/status"
set y2label "HDOP (smaller = better)"
set y2range [0:100]
set y2tics border
set title "Garmin GPS35, logging no. of sats & status, ELAB GEO, UIB"
set key left box
plot "gps.dat" using 1:3 title "No. of GPS Sats" with lines lw 3, \
"gps.dat" using 1:2 title "GPS Quality code 0=nofix, 1=non-diff fix" with lines lw 3, \
"gps.dat" using 1:4 title "HDOP" with lines axes x1y2 lw 3
</pre>
<:vspace>
<:vspace>
<:vspace>
<:vspace>
!Recording activity
In addition, we need some kind of alarm when data production ceases ...