USAGE:   procag [options] set-or-drop-files

PURPOSE: In Absolute Gravimetry, print/process a range of drop- or set-files.
         Values that are always printed include:
         Date and time, g unreduced, Sigma_or_Error, Accept, Reject
        
         Set-files contain a numeric Accept column. For selecting
         or rejecting records, the Reject column or the error information
         can be used. (No option yet to reject records with Accept numbers
         below a threshold.)
        
         A range of additional columns can be selected. They will be
         printed formatless after a delimiter "::". See the -c option.

         Dates are in Year 0 DOY. To convert to Gregorian:
         Pipe output through
         | jdc -k3 -F:i4,i2,i4,3i3 -C -i1,0,20,80 -mb
         (no -v or -V option then)
         To convert to Julian,
         | jdc -k3 -F:i4,i2,i4,3i3 -d -i1,0,20,80 -mb
         Consult http://barre.oso.chalmers.se/hgs/hgs.man/jdc-v2.html
 
         Consider the script ag2tsf running procag and jdc pipes

         bin/procag is a link to the perl file TD/a/Allsets/procag.pl

OPTIONS:
 -d          - Print first and last date and time. To convert DOY:
               pipe into  | jdc -k3 -F:i4,i2,i4,3i3 -i1,0,0,0 -C -mb

 -a v        - Mark "Reject" also those records where Error
               (respectively, under option -s, Sigma) exceeds v
               Works with drop-data. With sets, add the -R option.
 -A          - Show all records
 -R          - Show all records except those with Reject ne 0
               Applies to set-files only, else program will stop.
 -R -a v     - Reject by error level, for use with set-data only.
 -R -n n     - Reject if number of accepted drops < n

 -r          - Reduce the g-values with the one from the first record
 -g          - Reduce the g-value with fixed  981715930 uGal
 -G g        - Reduce the g-value with g (uGal)
 -N        - Reduce the g-value with g (nm/s^2)

 -s          - By default, the Error is printed. -s changes to Sigma.
 -u          - By default, output is in nm/s^2. -u gives uGal

 -c c,c,...  - (comma-separated strings, column labels).
               A list of columns to be added to the lines of print.
     Special column labels:
     G_inst    ("instantaneous g"),
               with tide, load, pressure and polar restored.
     G_red     observation, reduced with the constant (-g -G -N -r)
     G_model - predictions Tide+Load+Press+Pole
     G_user  - prediction with the user's combination ( -U )
     G_ures  - residual with the user's combination ( -U )
 -U c+c...   - User combination; c (string) is any column label,
               the delimiter is a plus-sign.
               To combine e.g. Tide and Load, specify -U Tide+Load

 
-F          - Add file name in output.
 -M mark     - Add mark (text) in output.
 
-f fmt      - Print additional columns formatted. Same code is applied
               on all (sorry)

 -S          - Produce "SAMPLE At "         records (for tsfedit / tslist)
 
-T #offs    - Produce "SAMPLE O=#offs At " records (for tsfedit / tslist)

 
-V          - Also print column labels and a table footer.
 -v n        - Print column labels, n-1 records,
and output footer.
               Without -v nor -V the output will be purely numeric.
 
EXAMPLES:
         procag.pl -g -c G_inst -V AC_20140530_S.drop.txt
         procag.pl -s -g -c G_inst,Error -f %10.2f -V AC_20140530_S.drop.txt
         procag -d a/Alldrops/Onsala_AC_20090706a.drop.txt | jdc -F:i4,i2,i4,3i3 -i1,0,1,0 -k3 -C -mb
        
     Create a complete tse-file for sampling an SCG series at AG-drop times:
         cd ~/TD/a/
         cat <<END >! smp.tse
         TSF EDIT SAMPLE
         OPEN 31 B smp.dat
         SAMPLE U=31 +C=::
         END
         procag.pl -S -F -s -g -c G_inst,Error -f "%10.2f " \
                   A?_201405*_N.drop.txt >> smp.tse
         echo END >> smp.tse

     After synchronity analysis with Seismometer, detecting that AG is late by d seconds,
     replace the option -S in procag.pl above with
        
procag.pl -T d -F -s -g -c G_inst,Error -f "%10.2f %10.2f" \
                   A?_201405*_N.drop.txt >> smp.tse