plot-tgg    Plotting tide gauge traces and periodograms


USAGE:    
          plot-tgg [options] tgg-file [tgg-file ...]


PURPOSE:

Plot of a trace-diagram from a tide-gauge file produced with otemt1. Stations can be selected.
If more than one tgg-file is given, plot trace on trace, decreasing thickness. Keep the number of files to 4 or less.

You may call the script from a project subdir. If tgg-files from different projects are to be plotted, the
working directory must be one level above the project subdirs.
 Sub-directories are automatically produced:  tmp/  plot/
The final png-files are saved in

Periodograms can be produced from only one tgg-file at a time; see plot-pdg.
pdg-files are produced by the script under the -P[DG] option and stored site-by-site in the same sub-dir as the tgg-file.
The periodograms will not separate the curves vertically. Instead, a legend is produced from ./tggs-legend
A legend file must be maintained manually; it may look like this:
BALTIC/Gavle-tgg-*.pdg       Gavle
BALTIC/Gdansk-tgg-*.pdg      Gdansk
BALTIC/Haparanda-tgg-*.pdg   Haparanda
BALTIC/Kiel-tgg-*.pdg        Kiel
BALTIC/Mariehamn-tgg-*.pdg   Mariehamn
BALTIC/Riga-tgg-*.pdg        Riga
BALTIC/Ringhals-tgg-*.pdg    Ringhals
BALTIC/StPetersb-tgg-*.pdg   St.Petersburg
BALTIC/Stockholm-tgg-*.pdg   Stockholm

(note the wildcard character; the file names checked against the pdg-files of the plot are expanded by globbing.
Unresolved legend entries will run the pdg-file name.)
The script will print the commands needed 

OPTIONS:

  -PSD sdir   - subdir under ~/www/OTEQ/ for the final png-files.

  -PDG        - plot only periodogram (actually, a trace-plot ps-file is produced: tmpps.ps,
                but no png-file.

  -P          - trace-plot and periodogram. Only one tgg-file may be given.

  -R          - "Repair", separate coagulated columns. Is needed only the first time
                a tgg-file is used. The original file is backed-up (extension .orig added)

  -S          - Prompt to select sites.
  -SO         - Use the most recent selection (from file tmp/columns.select)
  -s file     - Use the selection saved in tmp/file
                To save a selection, issue cp
tmp/columns.select tmp/file

  -y y        - Separation between traces by y given in the units in effect,
                see -mm -cm
  -mm | -cm   - y-units are millimetres or centimetres. Default is metres.

  -t [b]-[e]  - Time range in hours (will apply to periodograms too).
                The `-ยด character is compulsory.
                Defaults: b = first, e = last hour of tgg-file (column 3)

  -p ps-file  - Postscript file name, default is derived from tgg-file
                Don't code a path; the file is always produced in plot/

  -e e-file   - A file with events
               
name time,colour
               
to draw a vertical line at a point of time and decorate
                with the label, using the specified colour for both


EXAMPLES:

(1)
  plot-tgg -y 4. -R -P -p tgg-BPropNSlope.ps BALTIC/tgg-BPropSlope.daf
          
User detects that the default trace separation is too small, so ...
  plot-tgg -y 4. -R -P -p tgg-BPropNSlope.ps BALTIC/tgg-BPropSlope.daf

(2)
  plot-tgg -S -t 1000- -y 4. -R -P -p tgg-BPropSlope-late.ps BALTIC/tgg-BPropSlope.daf
  cp tmp/columns.select tmp/myset.s
(for a backup)  
          
User excludes Ringhals (uninteresting) and St.Petersburg (large signal).
           Next time, the same set of sites is included when the early part is plotted... 
  plot-tgg -SO -y 3. -R -p tgg-BProp-fricSlope-start.daf \

           BALTIC/tgg-BPropNSlope.daf BALTIC/tgg-BProp-f0.01Slope.daf BALTIC/tgg-BProp-f0.04Slope.daf

(3)
  setenv +S+QBF0.2+AM+E
  otemt1 @ BALTIC/otemt-dfo-slope.ins | tee BALTIC/otemt-dfo-slope.log
  plot-tgg -PSD BALTIC/ -R -SO -p tgg$MARK.ps -y 2 -e BALTIC/tgg-events.dat BALTIC/tgg-BPropNSlope$MARK.daf
          
with
tmp/columns.select

print $1,$6,$8,$12
Mariehamn StPetersb Inkoo

           and BALTIC/tgg-events.dat

X-stop 36,255/0/0

 

.bye