Utter - Elder - Holt

The Broker

Utter or Elder take on a four tasks dealing inbetween Brimer (the data source) and Holt (monitor and retro-agent).

The procedures to be started with
cd
source minipath
cd ~/perlproc/SCG

source START

are
/home/HGS/perlproc/SCG-accu-agent.pl        - receives Brimer's UDP-stream.
/home/HGS/perlproc/file-monitor-agent.pl    - fills in eventual gaps, creates files e.g. for 11-mems.
/home/HGS/perlproc/tide-press-plot          - more or less obsolete. Holt runs a more advanced version.
/home/HGS/perlproc/11-mems                  - creates the power spectrum plot for the monitor.
These programs are active at all time except when expressly stopped.
How to stop? Issue
cd ~/perlproc/SCG
STOP -h

The broker function

To appreciate this part you need to reflect what's running on Holt to keep the monitor-plot.html page going.
The relevant script is SCG-html-agent.pl -> ~/perlproc/SCG-html-agent-withlogfile.pl
There are other versions; one is recent and not yet installed ("PT")

cd ~/perlproc
ls -l SCG-html-agent*

See the help text for other two processes involved in the monitor page, however not dependent on the broker,

~/perlproc/eqwatch.pl -h
~/let/retro-agent -h

O.k., the broker.

In  SCG-html-agent.pl , after a gap-test with

~/bin/monitor-gaptest -q $file

($file = monitor), if gaps have been detected, the file $tmpf = ~/www/hgs/monitor.txt  is copied from the broker.
Depending upon which computer runs the scripts and which one is taken down for system work

cd ~/perlproc
set-broker -f utter

or

set-broker -f elder

Visit the man page of SCG-html-agent.pl for more details.


SCG-accu-agent

USAGE:
SCG-accu-agent.pl [options] <file-bn>
PURPOSE:
Appends Brimers UDP-stream to file-bn ("file base name") with name extension .wrk  .
This file (ASCII) is worked upon by file-monitor-agent and 11-mems further down the line.

The program stops if a file  ~/perlproc/SCG/STOPAGENT exists (i.e. is created during its lifetime.)
OPTIONS:
  -q        - Quiet. Only little output to STDOUT (at start or if problems are encountered).
              Else the stream data is printed on STDOUT
  -D        - Debug. Much printing.
  -c #cal   - Calibration value                                       [-774.421 ]
  -b #baro  - Barometer coefficient                                [  -3.286 ]
  -g #bias  - Gravity residual offset                               [   280.0 ]
  -p #port  - Port number                                               [   54321 ]
  -s #sleep - Sleep seconds                                            [      50 ]
  -h        - Prints usage and options.

EXAMPLE:
SCG-accu-agent.pl -q monitor


file-monitor-agent.pl
USAGE:

      file-monitor-agent.pl [options] <file-bn>

PURPOSE:
Takes a 60 seconds <file-bn>.wrk chunk that SCG-accu-agent.pl made and
All file production is carried out with system calls coded like  `shell-command arguments`;
If you want to see them, do
cd ~/perlproc
fgrep '`' file-monitor-agent.pl
Stop this program with  touch ~/perlproc/SCG/STOPAGENT
 
OPTIONS:

  -q           - quiet
  -D           - debug
  -N #lines    - length in minutes for the file handed down for plot (11-mems)   [ 3600 ]
  -G           - deny filling gaps                                                                            [  allow  ]
  -s #seconds  - sleep                                                                                                  [ 50 ]

A directory list shows what the script and its employees create:
-rwxr-xr-x  1 HGS None        8 Apr 26 11:47 break.lock        - an anti-clobber indicator
-rw-rw-r--  1 HGS None      228 Apr 26 11:47 fmg.prt           - diagonstics from fill-monitor-gaps
-rw-rw-r--  1 HGS None        0 Apr 26 11:47 newbreak.dat      - would show meta data for gaps in the ...
-rw-rw-r--  1 HGS None    28884 Apr 26 11:47 monitor.ts        - binary 1-h file
-rw-rw-r--  1 HGS None        0 Apr 26 11:47 Sgf.prt           - messages from gap-filler.pl
-rw-rw-r--  1 HGS None   446400 Apr 26 11:47 monitor.txt       - the most recent 3600-s
-rw-rw-r--  1 HGS None   453840 Apr 26 11:47 monitor.txt.tmp   - the most recent 3540-s
-rw-rw-r--  1 HGS None     7440 Apr 26 11:47 monitor.wrk       - the most recent 60-s
-rw-rw-r--  1 HGS None        8 Apr 26 11:47 wrk.lock


11-mems
 
 USAGE:  

         11-mems [-D]
 
       No arguments, option -D for debug.
       Help text is obtained with option -h
       Modification at runtime using environment parameters and small files.
 
 PURPOSE:
 
       This program is active indefinitely (until a file STOPMEMPLOT is
       created in /home/HGS/perlproc/SCG ). When the monitor.wrk file arives,
       and if it starts at a full hour, prepares a MEM Power spectrum with
       graphics using GMT.
                Besides a full 1-hour Bartlett spectrum (true? used?), 10 curves are produced from
       a sliding interval, 20 min long each at 6 min report.
 
                Uses sasm03 -> ~/bin/sasm03.x for power spectrum estimation.
                The source is in ~/sas/p/mg/sasm03.f
 
       The full one-hour spectrum (ASCII) is saved in /home/HGS/perlproc/SCG/MEMS/ under
          <Julian date:hh>.msp
       We started with this archiving on Dec. 4, 2012
 
 
 ENVIRONMENT:
 
   SCPPGM   - name of the script for scp of graphics to destination.
                      Default = scp2h
                      for destination Holt
 
 
 CONTROL FILES:  (in ~/perlproc/SCG/ )
 
  STOPMEMPLOT   - if created while program is alive, program stops when it finds it.
 
  LIVEMEMPLOT   - shows a line with date+time when the program was last alive.
 
  FORCEMEMPLOT  - forces the immediate creation of a plot first time round
                  on existing data; else, program assembles a new 10-minute slice.
 
  MEMPLOTNOW    - assembles new data sufficient for one spectrum and exits. 
 
A directory list shows what the script and its employees create:
-rwxr-xr-x  1 HGS None    64526 Apr 26 14:11 11-memsp.ps                    - postscript
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monitor.memsp           - ASCII the most recent MEM power spectrum
-rwxr-xr-x  1 HGS None    23009 Apr 26 14:11 sasm03.prtmp                   - sasm03 log file
-rwxr-xr-x  1 HGS None     1448 Apr 26 14:11 sasm03.99                      - sasm03 auxiliary log file
-rwxr-xr-x  1 HGS None    43219 Apr 26 14:11 sasm03.pef                     - the PEF assoicated with sasm03-monitor.memsp
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03.sp                      - the Bartlett estimate of power spectrum
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03.memsp                   - identical copy of sasm03-monitor.memsp           
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-2880-3600.memsp   - and below, the first 9 spectra that are combined with the most recent
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-2520-3240.memsp     to fill the diagram
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-2160-2880.memsp     ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-1800-2520.memsp     ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-1440-2160.memsp     ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-1080-1800.memsp     ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-720-1440.memsp      ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-360-1080.memsp      ...
-rwxr-xr-x  1 HGS None    42752 Apr 26 14:11 sasm03-monit-00-720.memsp        ...
-rwxr-xr-x  1 HGS None    28884 Apr 26 14:11 sasm03-input.ts                - Input, binary file, the last hour.