tide-press-plot
actual-retro

USAGE:    
           tide-press-plot [options]

           tide-press-plot -U[F][A][G] -S sleep
           tide-press-plot -M { YYYY MM DD | YYMMDD }
           tide-press-plot -V
 
PURPOSE:
         Appends the data file for SCG-Monitor's tide-and-pressure plot
         and produces the plot files ~/www/SCG/PNG/tide-press-plot.png
         and ~/www/SCG/PNG/tide-press-big.png.
         This routine can be run after the croned get-tide-data script
         and until midnight.
         It can run in one-trip mode or in GO mode with a repeat interval.
 
         The data that is used is in ~/TD/d/G1_garb... concerning yesterday
         and in ~/TD/SCG_MONITOR/G1TODAY.054, which is sent from Brimer
         at every full hour.
 
         The data that is maintained is in ~/TD/SCG_MONITOR/ :
         G1_apb_30d-retro-1h.tsf - Atm.P., Pred.Tide, Tide+Baro Resid.
         G1_b_30d-retro-1m.tsf   - Tide+Baro Residual gravity observation.
 
         Always (except -V -M): Remove old copies
         G1_garb_??????-1s.mc and G1??????.054 from ~/TD/SCG_Monitor/
 
OPTIONS:
 
 -U[F]        Requests update. Without -U the data is updated only when the
              programs runs for the first time today.
              With F, forces update with the whole series from yesterday and
              what is available from today. Useful if the 30-days series has
              gotten gaps yesterday or today; avoids the lengthy -A job.
 
 -A           Reprocesses the G1_*_30d-retro-*.tsf files.
              Invokes the script ~/TD/SCG_MONITOR/actual-retro

              If there is nothing else you want to do, run the update manually:

                 cd /home/hgs/TD/SCG_MONITOR
                 actual-retro  -1m -t b ; actual-retro
              OBS! IN THIS ORDER
 
 -P           Only Plot, using data as is
 
 -G           Go. Cycles with a sleeping interval, see -S
 
 OPTIONS above can be collected: -UAFPG
 The following options must be specified separately:
 
 -D file,D  - Apply drift parameters from a tse-file, with D as the target
              e.g. -D drift.tse,DRIFT
 -DD          same as above, however using use the default
              /home/hgs/TD/tide-press-plot.tse,DRIFT
              The tse file can be produced with
                 cd ~/Ttide/SCG
                 prl2tse -S+ -o ~/TD/drift.tse o/g100202-OPNEND-1h.prl DRIFT
              However, the end-dates of the time ranges must be
              hand-edited in order to be valid some time ahead.
              Or try to pipe the output through  ~/bin/date-ahead
 
 -M YYMMDD  - Mends a gap for this date and exits. Reissue with -U when all
              gaps are closed.
 
 -V           Finds gaps and exits.
 
 -S sleep   - The sleep interval is in units of 10 seconds. Default 300
              This is to allow to break the cycle by creating a file
              STOPTP in either /home/hgs/www/SCG/ or /home/hgs/TD/SCG_MONITOR/
              The program will stop within 10 s
 
 EXAMPLES:
    From crontab, first example shows the first invocation on a day
    next one the afternoon run.
 
             /home/hgs/TD/tide-press-plot -DD -U
             /home/hgs/TD/tide-press-plot -DD -UF
 
 PROBLEMS:
    If the gravity line (residual,black) is broken (first seen at its end), the reason is
    most probably that the default drift file, /home/hgs/TD/tide-press-plot.tse, has bad dates.
    ts4openend is supposed to regularly create a new version (run under cron), but only if the
   
directives string contains `-UDMยด. To manually update the drift model,
    cd /home/hgs/Ttide/SCG
    set begd=090615 var=-atm
    prl2tse -q -S o/g${begd}-OPNEND-1h$var.prl DRIFT
    cat tmp/prl2tse.tse | /home/hgs/bin/date-ahead >! /home/hgs/TD/tide-press-plot.tse
    If you however plan to use the drift model for a long time to come, you can remove the last
    To-dates in tide-press-plot.tse, as shown in grey below:
 ADD  2.316366e+02 From 2011 02 23 00 00 00 000 To 2013 10 23 22 59 59 000
 ADD  2.587045e+02 From 2013 10 23 23 59 59 000 To 2018 10 03 11 59 58 000
 ADD  2.634327e+02 From 2018 10 03 12 59 58 000 To 2019 06 28 18 59 58 000
 SLO  1.535834e-02 [h] Tref 2010 04 20 11 30 00 000 From 2009 06 16 00 00 00 000 To 2011 02 22 23 00 00 000
 SLO  3.161450e-03 [h] Tref 2012 06 23 23 30 00 000 From 2011 02 23 00 00 00 000 To 2013 10 23 22 59 59 000
 SLO -4.120753e-04 [h] Tref 2016 04 13 17 59 58 000 From 2013 10 23 23 59 59 000 To 2018 10 03 11 59 58 000
 SLO -4.085871e-03 [h] Tref 2018 12 23 15 59 58 000 From 2018 10 03 12 59 58 000 To 2019 06 28 18 59 58 000
 EXP 134.2  ${ADECAY:[-2.2663D-03]} [/h] Tref 2009 06 15 12 00 00 000  From 2009 06 15 12 00 00 000 To 2011 02 22 11 59 59 000
 EXP -95.1358  ${EDECAY:[-9.4194D-04]} [/h] Tref 2011 02 23 00 00 00 000  From 2011 02 23 00 00 00 000
 END
    Finally, to run tide-press-plot manually, use the bash wrapper script:
         tide-press-plot.sh
 
  crontab:
  10 22 * * 5 /home/hgs/TD/ts4openend GBR-PMR-AT-TG-TAXP-UDM > /home/hgs/TD/logs/ts4openend.log  2>&1