tslist   { filename | - | generating option } [options]
    tsl [+a]
{ filename | - | generating option } [options]


     tsl with no argument returns the name of the last written protocol.


 TSLIST_LEAPS  nonempty - recognise leap seconds
The -TLS option will toggle the leap second setting.

Protocol files (tsl): The output file, including the target directory (with symbolic links resolved), is appended
with `.log´, and all `/´ are replaced by `%´.

associated with  
More options to tsl:

  +a                    append the log-file
  +l directory          to replace $HOME/tslist-logs
  +L logfile            name of the log-file instead of the auto-generated.

"Multi-column": If you need to quickly bind several binary time-series files into one multi-component ("mc") file,
consider  ts2mc as a model to code up a similar script.

 Maximum length = 1,000,000 (c.f. PARAMETER (NDIM=) in ~/sas/p/mt/tslist.f

 Reserved file units: 21 (input), 31 (output, optional), 4 (TSF EDIT, optional)
 With the -1c option up to 10,000,000 samples can be handled; this decreases though
 if the -E is used. 

Compulsory code in boldface, otherwise user-supplied parameters etc.,
        s - single character or numerical value,
code etc. - a string,
      [ ] - optional

 Option      - meaning                                                      [default]


  -          - Input ascii from STDIN.               

  _n[,v[,c]] - Generate a file of length n with value v in column c.         [0.0d0,1]
  _n[,v[,c]] +c2,v2
[+c3,v3 ... ]
               (OBS! swapped order between `_´-generation code and `+´-parameters) 

  +n[,s][,t] - Generate a random series. Use -B -r and -0
               to set epoch, rate and start. Use -Svalue to set amplitude.
       (CAN WE DO COLUMNS 2... LIKE UNDER `_´ ?)
               if s is not given, a series of zeroes is produced. Else...
               s is the random seed, t controls the distribution
               s must be a negative number
= U for a uniform distribution
               t = [m,]G for a Gaussian distribution with Markov parameter m.
               t = b,F for a fractal distribution, spectral power P(f) ~ f -b             
               n specifies the number of samples. 


  -I         - print protocol information only.
               Else: protocol and time-
series. To strip protocol,
               pipe through fgrep -v '>'
or output time-series to ascii file using option -w


             - "Ticks" -  print range and tick information for GMT.
  -ts          Suppress printing of the GMT option string (no -R or -B)
               The -t option should be given early on the line so that
               the report from an eventual -Bepoch option gets muted.

  -tS          Capital-S will print items without delimiters.

    sopt = t[x|y] - requests a suitable string for the GMT-grid/tick option (-b)
    sopt = r[x|y] - dito for the GMT-range option (-R)
                    x resp. y requests the information for the x resp. y axis only.

    dopt = dymin/ymax:
dopt = Ddummy/dummy/
suggest a minimum range that the actual data may extend.
               The / may be replaced by a comma. We don't have this for the
               time range yet, sorry!
              This option must be delimited with a colon at the end.

    topt = minx,maxx[/miny,maxy][fopt][bopt]
               where the numbers control the minimum and maximum number of  
               labeled ticks on each axis.

    fopt,f:nx,ny or ,fx:nx or ,fy:ny
               where the numbers nx and ny indicate fixed amounts
               of unlabeled tick intervals (INTERVALS!)

               where by is a range-margin, e.g. by:0.2 to extend the min-max
               ordinate range on each side by 20%. This is useful to get
               generous plot boundaries.
               String bopt must be last. A bx option is not implemented (yet)

           -t  implies -I and -qq (stop before copy to STDOUT, quiet)

               $ tslist +59,2,U -I -td-5/5:,by:0.1 -rs1 -n1
               -R0.000000/60.000000/-6.00000/6.00000 -Ba10.00f1.000/a2.000f0.1000

  -qs[s...]  - query information
  -qb -qe -qa -qbe          
             - first (s = b or a) and last (s = e or a) date.
  -qB ...    - s = B  s = E  s = A like above, a record with tslist options to
limit the time scope of input is written, however:
               ({ -Byyyy,mm,dd -Hehh,mm,ss,ff } { -U
yyyy,mm,dd,hh,mm,ss,ff })
               Add a c to produce the cutting version of the -B and -H options:
               -qAc produces
-Bcyyyy,mm,dd -Hcehh,mm,ss,ff -Uyyyy,mm,dd,hh,mm,ss,ff
               If the apply-early option -He is not desired, use -qBl or -qAl .
               Thus you can input a series with the date limits of another series:

               tslist file2.ts `tslist file1.ts -I -qAc | grep -e '^-'` ...     

  -qm[y,Y]   - query minimum and maximum and their times of occurrence.
               Extend on the specified range y,Y                        [1.d40,-1.d40]

   qc        - query comment part of label if there is one (mc-data only)

   qq -qqq   - quiet; suppress normal messages in protocol
               (not really a query, rather an anti-query).

  -L         - List all labels in a multi-column file.

  -IHD[i,j,k] - investigate Hausdorff-dimension. The starting point in the
               time series is stepped through a do-loop DO io=i,j,k            [1,1,1]


  -1c        - For time series with more than 1M samples, this option makes
               the entire multichannel memory available for one time series.
               Mnemonic 1c = one-column. This option must be given first,
               since it affords new defaults for array sizes and truncation points.

               WARNING!!! Multicolumn options will fail to work correctly.
               No safeguards have been built in yet.

  -D[I][fmt] - remove DC-level. The value is printed under format fmt.
               The I option requests the DC-information only for print;
               actual removal occurs only if I is avoided.
               Reading mc-files, the DC-level is removed only

               from column 1. To remove it from all columns,

  -D[I]Cc1,c2,... - remove DC-level from channels c1,c2...
[I]A[fmt]     - remove DC-level from all columns.                       [1p,d13.4]

  -Yy,y...   - offset column ordinates by respective value y                  [0,0...]

  -YRANs,a[s,a...][t] - add noise, t = U uniform, t = G Gaussian, with
               amplitude a on the respective column. You need  a=0  in order
               to  keep a column unaffected (e.g. if column 2 runs the
               uncertainty). s is the seed.                               [-1,1,...,G]
s,m,a,...][t] - Like -YRAN, but add Gauss-Markov noise with
               Markov parameter m.
s is the seed.                       [-1,0,1,...,G]
               See the +{u|g|f}-option to control different additional
               noise types in different columns.

  +{u|g|f}[c:]a,s[,p]  - Add noise to column c (default 1) with amplitude a
               and seed s.
           u - uniform
           g - Gaussian
           f - fractal with power-law parameter p

  -R[s]p,t0,dt  - Resample. p is interpolation polynomial order,
...............t0 is time-shift [h], dt is new time step [h].
               Use -Rs with time specifications in seconds.

  -E[c1,c2...:][ ][tsefile][,target[]option]]  -                   [1:tslist.tse,TSLIST]
               TsfEdit commands are read from file (unit 4).
               Up to 10 -E options can be issued. They are applied left-to-right.
              Default tsefile = previous file
               target and option: cf  ~/sas/p/tsfedit.f

               c1,c2...:  (right-delimited by `:´) specify the data columns
on which the processing is to act; default=1.
               Caution if the file name or target or option contains a colon:
               In that case a delimiting colon must be given (-E:),
               even if defaulting to c=1
is intended:
             -E:filename,AB:CD   should work (if there's no bug).

  -Alistfile[,| ][tsefile][,target[]option]] -
               for appending many files with filtering and decimation
               (or anything else you'd like to do with TsfEdit)
               See the example in ~/sas/casc.tse .
                 Only one label = one MC column can be processed at a time.
                 The -Llabel declaration must be valid for the entire
                 set of files.

  -Mm        - define missing record symbol for internal use and binary output,
               num.value m . Also resets the test accuracy to 1.0             [internal]

  -MTa       - define test accuracy, num.value a
-MT must appear after -M.   

  -MSYNC       On multiple columns, delete all rows that carry one or more missing records.
MSYNC, plus contract to close the gaps.

  -Mother    - see print options

  -m[o]      - mend (repair) with option o. Option 'L' requests linear interpolation.
               Else: substitute DC-level                                            [' ']

  -S[/]s[,s...]  - multiply time series column j with scale value s(j).

                   A zero value for the 2nd etc.
s defaults to |s(1)| !!! !!!
                   (useful for measurement in column 1 and uncertainty in column 2)

                   / - divide by s (else multiply with s)
                   (before TSF EDIT
  operations).                                [1,0,0...]
  -SO[/]s[,s...] - like -S, but after TSF EDIT and -U operations).              [1,0,0...]

  -SQ            - take square root of time series (MRS at negative values)

  -SR[/]s[,s..]  - scale time series to unit-RMS deviation, further divide by s
                   / - multiply (sorry!!!)                                      [1,0,0...]

  -SM[/]s[,s..]  - map time series to interval [-1,+1], then multiply with s 
                   / - divide                                                   [1,0,0...]
[/]s[,s..] - like -SM, but after TSF EDIT and -U operations).             [1,0,0...]

                   NB: We don't have -SOR (yet) Use tsfedit! !!!

                             Some "row maths" (more maths: see Label maths)

              - Linear arithmetics.
                X(ct) = Sum si(ci) X(ci)
          e  - apply early with respect to Tsf Edit and other row maths               [e]
          l  - apply late, right before output (verify!)

             - square-sum arithmetics. Sums comprise columns #c1..#cm
Result is stored in column
          - divide by the number of columns
          s  - take the square-root
          r  - remove DC-levels before squaring
          e  - call time_range reading a hard-wired file tslist_trms
(one line) - needs to be built out
          v  - set to missing-record symbol outside the time range.
               The result is copied into column #ct
k  - The number of active columns will be kept
               (else it is set to #ct)
               Defaults: none for options, none useful for c1..m
but #ct defaults to one column of extension
               A 3-D vector norm would be evaluated using
               -RMQr:1,2,3=1   or  -RMQr:1,2,3=4
               in conjunction with multicolumn input e.g. -L'X|V' -L'Y|V' -L'Z|V'

             - Transform from X Y to Polar R Phi
               columns c1 and c1+1 to ct and ct+1. Options:
           r - remove DC-levels
           d - Phi in degrees                                                     [radians]

             - Transform two neighbour columns in a quadratic fashion
c1 and c1+1 to ct, ct+1, ct+2.                         [c1=1, ct=c1]
               Default method:
c12 -> ct,   c22 -> ct+1,   2 c1 c2 -> ct+2

           s - Method square-roots:
2)1/2              -> ct,
c12-c22)|c12-c22|1/2  -> ct+1
sgn(c1 c2)|c1 c2|1/2     -> ct+2
           e - Method: Square-root-Eigenvalues into ct and ct+1,

               principal ev-direction into ct+2.
               cf \hgs\Mathematica\Eigen2x2Symm.nb
           d - (under e:) Direction in degrees                                    [radians]
           r - remove DC-levels

             - Time-dependent admittance estimated from a moving window
               of width w. Moves from index b with step s
               A tapered window of type can be used. KAIS: specify design
               parameter p. The formula is 
                 Xct =  Sum Xc1 * Xc2 / Sum (Xc2)2
The result is stored into column ct (default: 1).
          +X - Additional columns are prepared:
                  Xct+1 for Sum
Xct+2 for Sum Xc1 * Xc2
               Defaults b,s,c1,c2,type,p                          [0, w/2, 1, 2, RECT, 1.0]
               Example: see TD/Atmacs/HOW.TO
               Risks: A work array is used, the size of which might be too small.
                      Columns may be overwritten unintentionally (esp. with -X). 

             - modified covariance between columns 1 and 2
      u,file - output to binary file, file unit u
    #L,#s,#r - the Cov(k) is computed by
                  Sum{i=1,N,r}: c1(i+s+k) c2(i+s)   for k=-L...+L

Cycle slips

This is a very special function. Examples
tslist -L'A|R' -L'S|Z' -L'S|E' -L'S|N' -I -CYCSLIP10.0,-2,2,T=0.

tslist ${SAXD}data/${SAXD}-s${lag}.mc -L'A|R' -L'S|'$COMP -I \
       -CYCSLIP${cyci},-2,2,O#51:cycsl-${COMP}.dat \
       -O:`label AG,CYC${COMP}` ${SAXD}data/ | m
Usage see tslist-cycslips.html
Date cutting
 (see also -j under Print Options for an index-controlled cut)

        - Set the epoch at midnight of today

  -Be        - If none of the following sub-options, is used,
               set the beginning at the epoch's midnight.
               NOTE: This option appears necessary
for -n output time tags.
               Should work as a default
(i.e. when qcut and qfix are both .false.)
               in order to distinguish -n from -nr such that under
the first tag is at the time of the first record while under
the first tag would be zero.
               Why we appear to need -Be is not really clear. Use -Be as a quick-fix.

Cut samples worth duration t from start,

-B[a]n       s = h m s or f specify in what units, hours (default), minutes,
seconds or milliseconds, respectively. Adjust epoch right before
               cutting date (a).
(useful if time series has significant start lag).
is synonymous with -B[a]t.

  -B[a][c|f]date   - set beginning epoch. Default=first date on file.
               Set (= "fix" against) epoch (f), cut at epoch (c).
               Adjust epoch always before the cutting date (a) (useful if
               time series has significant start lag).
               Default = no fix, no cut.
               Format for date is yyyy,mm,dd

  -BH[a]cz   - undocumented; sets hour for cut to almost infinity (?)

             - cut at (c), or suppress before (s),
               date and hour,minute,second,1/100s
               With s: as would be a contradiction. The s option is really
                       useful if you want index-related time tags (-N -Ni)
                       to count from the start of the time series. The
                       epoch will be set according to the input file. 

               With c: set the beginning epoch at this date and the starting hour
                       at this time of the day.

               Format for date is yyyy,mm,dd

               Hour h may be specified as a decimal number; then m,s.. cannot
               be given.
  -BH[a][c|s]{J|R|M}#j   - date j is given in Julian date, full (J), reduced (R)
               or modified (M).
               ( suppress-until with option s is perhaps not implemented yet.
                 A different option understanding/decoding:
                 { [a|s] | { [[a]f | [a]c] } } 
                 clearer on adjust/suppress versus suppress/(cut/fix)
                 would allow -Bsn and -Bst  )

               E.g. tslist d/g1-090810-1s.ts -qbe -BHc2009,08,10,18:12:12 -C3
               E.g. tslist d/g1-090810-1s.ts -qbe -BHc2009,08,10,18.02 -C3

    Note: If you intend to call tsfedit to work on the series such that cutting effects at the start occur, do not use the  -BHc  version of the option.
    It will first shift the origin to a day boundary, then call tsfedit, and then shift the remainder---which may have been cut off.
    Rather use   -Bcyyyy,mm,dd   specifying one day earlier, and  -Hv  with a value  v > 24 h
    In this way you will preserve a lead-in data segment.

  -H           is similar to -B but restricts scope to hour part. Epoch setting
               is not dealt with; that must be accomplished during file inoput
               or by epoch setting using  -Byyyy,mm,dd .
               An e sub-option requests that the cut is performed after tsfedit
               processing is complete.

  -H[a][t][c|f][e|l]h   - fix (f) or cut (c) against number h of hours from epoch
        n      (h may be specified as a decimal number or in the
               form h[,m[,s[,f]]] with legal delimiters , - : )
               or cut at h samples from epoch (n).
               Adjust epoch right before cutting date (a)
               Apply early (e) or late (l), meaning before or after tsfedit,
               (-E option). Default is cut and late.                               [0]
  -Uu        - Truncation of various kinds, suboption u see below.
               Default is to output all data of course.

  -Uhn       - truncate to achieve duration n hours.                          
  -Udn -Umn -Usn   like -Uhn, to alternatively specify days, minutes, seconds.
  -UHh[,m[,s]]  ... to specify duration in hours, minutes, seconds

               This (H, h, d, m, s) works cumulatively.

         OBS!  If -Uh or its variants above are specified, it takes precedence
               over the -U's shown below.

  -Un[v]n    - truncate after n samples (n) or valid samples (nv).
               If  n < 0, truncate at n samples before the end          

  -Ul[v]n    - remove n samples (l) or valid samples (lv) from the end.

  -Uon       - truncate in output loop (reads and processes all data
               before output), number of samples

  -Uy,m,d[,h]- truncate at this date + hour 
              (h may be specified in the form h[,m[,s[,f]]], legal
               delimiters are , - : )


  -ws[a][:#n] [f]
             - One-column output, not time-tagged, -wsa for append.
               f is a filename                                                [STDOUT]
               #n is the column to output                                          [1]
               Unit 8 is used if a file name is specified.

               The -F -q.. and -I options are significant.

  -w[a] f    - Default time-series printing is to STDOUT.
               Use -w to redirect to a file,
-wa for append.
               The -q.. and -I options are significant.

  -qq        - quiet (suppress normal messages on protocoll)
  -qqq       - Quiet, -qq and suppress gap markers (>)
               The -qqq option affects the output under pption -w

             - The missing-record symbol on output for each column
  -zo#v      - The missing-record symbol on output for all columns
               Default is the binary input's MRS or if redefined by -M

  -j#n       - Jump; skip the first n values on output if n > 0
               skip the first N-1+n values if n < 0
               (e.g. -j-1 for the last value; however, this will yield
               warnings since rms-around-mean cannot be computed).
               There is presently no method to skip a specific number of
               valid samples. 


          The Time fields

  -C[R|X|Y][k][,D:fmt]][,F:fmt]]    - print date in Calendar form,
            k  hour-minute-second depth(khms
. Default from -k                     [0]
       R or X  Print reduced resp. full Julian date.
            Y  Print decimal year

               Default is modified Julian date.
       ,D:fmt  fmt is the format for the calendar date        [i4,2i3.2,1x,3i3.2,i4.3]
,F:fmt  fmt is the format for the Julian date                           [f13.6]

  -Tcode     - format code for float point time field, used for output.
               If code(1:1) needs to be Z, use \Z                               [f8.5]

  -TT[[s]b][{*|/}[s]f[sa]]   OBS! no blanks   OBS! quoting is required with *
             - linear expression for time record under options -i -N -J
           s   + or - sign
         a b   floating point
               output = ( t[hours] + sb ) {
*|/} sf + sa
               e.g. -i -TT-19.           (simple offset, subtract 19 from the hour)
               e.g. -i -TT-19./24+315    (yields days (with an offset of -19h and +315d))
               e.g. -J -TT'-55305*24'    (yields hours from the specified MJDay)
                    -C3 -Tf16.10
               2010 04 19  19 00 00       19.00000000     -36.39

               OBS! multiple values are cumulative:
               a's and b's are added up, f's are multiplied up.

  -TT[[s]b]:x[sa]  where  x = s m d y c
to yield a time record in units of
               seconds, minutes, days, years or centuries
               e.g. tslist -C3 -TT-55305:m -Tf16.2 -Ff10.2
               2010 04 19  19 00 00           1140.00     -36.39

               OBS! Mixed forms,
:x first, *f or /f after:
               The factor f will modify the time unit set by :x

  -N[code]   - Output time record is an ordinal number 1 2 3... Format code
               may indicate integer or floating-point real, depending on -n option.

  -n and -nr   ... in the following are equivalent; the difference being that
               time-tags are relative to the epoch or to the start of output,
               (If the first time-tag isn't 0, the reason is in variable ncutb)

  -n[hms][a] - Time record = j dt + a in hours (h), minutes (m) or seconds (s)
               from epoch + t0, add a. Specify e for a to obtain time from epoch.
                  tslist d/A2_9_120104-1s.ts -Nf16.8 -BHc2012,1,3,12 -ns -00
               (Sets epoch 1d before file start, forces t0 = 0 at epoch 2012,1,3,12
                thus first record is shown as 43200s after epoch, but actually
                belongs to 2012,1,4 - so it's an example how to fake a time shift
                with the -00 option.)

  -ni[b]     - time record = array index, yields   1+b      2+b   ... n+b          [-1]
If -Bnj has been given, yields      j+1      j+2   ...  n
If -Ulvj has been given, yields   n-j-m+1  n-j-m+2 ...  n
(m is the number of missing samples in that segment)

  -nff        - Multiply output time record under -N with factor f
f        - Divide ...
  -n/N        - Divide by the number of samples; yields 0.0 .. 1.0 step 1/(N-1)
             - Multiply output time record under -N with factor f and

               add or subtract b from index, and
               add or subtract offset a if s=+ or s=-
               The formula is  tout = (i+b)*f+a
               Specify  /  to divide, * to multiply (don't forget apostrophes '*' !)
               -nm will multiply to yield
tout in minutes, -ns in seconds.

               Example: -n-1*2    will yield    0   2   4   6  ...
                        -n-1*2+1  will yield    1   3   5   7  ...
                        -n-1/2+1  will yield   1.0 1.5 2.0 2.5 ...

  -ns+t0       You may specify the symbols t0 for b and dt for f in order to
               add the time of the first sample from the epoch and the sampling
               rate, respectively. It will be invalid to specify t0 for a

               Example: tslist o/scg-cal.ra.ts -Ff8.3 -Nf12.0 -n'-1*20' -C3 -qqq
               2010 04 19  19 00 00            0.  -36.393
               2010 04 19  19 00 20         3600.  -29.299
               2010 04 19  19 00 40         7200.  -48.745
               2010 04 19  19 01 00        10800.  -18.703
               2010 04 19  19 01 20        14400.  -45.400
               2010 04 19  19 01 40        18000.  -51.634
               2010 04 19  19 02 00        21600.  -30.810
               2010 04 19  19 02 20        25200.  -38.973

               OBS! The -TT option will once more transform the time record.

  -i[fmt]:[y]- Output time record is t0+n*dt (from file) in hours
Add y to time.                                                  [0.0d0]
               Use the -TT option for further scaling and offsetting.

  -J[fmt]    - time record is Mod.Julian date. fmt format code.                [f13.6]
  -JR[fmt]   - time record is Red.Julian date. fmt format code.                [f13.6]
  -JX[fmt]   - Exact (long) Julian dates; they start at noon.                  [f15.6]
               N.B.: The Julian date default comprises day and hour.
               If you only have the day (with or without decimal places)
               you must use -J with the -k0 option.

                           The Data fields

  -Llabel [ -Llabel ... ]  Input labeled columns; see section on input options.

  -Fcode     - format code for numeric field, used for output.

               If you process n labels you've got to output n columns,
               so you'll need to define n numerical fields, e.g. -Fnf10.3

  -FA[e][w]  - Let the program recommend a format. The maximum field width
               for a plain floating point value is w                               [8]
               Specify e if you like exponent symbol e                             [d]
               If the program suggests an exponential form, the
               number of post-dot places will be max(1,w-4)
               Exponential forms are always shifted using 1P.

               -FA can advantageously be combined with  -qqq -w /dev/null
               The last (and prospectively only) line output will then read e.g.
                <Main-->>> suggest FMT: -Ff8.3

               -FA is a new feature (May 2010) not really well tested.
               Subroutine: numeric_range in ~/math/afor/p/numrange.f
               Limitation: analyses column 1 only.

  -V[o][v]   - print numerical value v only at valid records
               o = I - print this value only at invalid records
               o = R - print zero at invalid, value v at valid records
               v1,v2,...  by default taken from -Y

  -MA[v]     - include the missing record symbols in the printout.
               v = replacement value. By default, the internal symbolic value
               is used.
               (To change the symbolic values for GGS output, use -zos1,s2,...
               Explained under -p)

  -MB | -MV  - make a list of changes in valid records.
               The output format comprises the date part as usual.
               The ordinates are suppressed. Instead, messages are
               produced reading date BEGIN FILE, END FILE and
               BEGIN BREAK (-MB) or BEGIN VALID (-MV)
followed by a line that lists the ending date and the
length of the block.
               (The flag is empty when regular records resume).
...............See example (15). -MA, -MB, and -MV are mutually exclusive.

  -TMC#c     - test for missing-record symbols in output column #c.                [1]

  -DI        - show DC-level. Without the I option the following commands
               -D... will remove the DC-level. See Processing options, -D...

  -pc:1,2,3... print c columns, permutation 1..10 of input sequence
               (Requires BIN reading from multicolumn files).

  -zos1,s2,... The missing-record symbols for the output columns in the
               order as they are printed, e.g. -p2:5,1  -zo99.99,-99.99      [internal]
               (-zo is currently implemented for GGS records (-TGGS) only)

  -Q         - Fail if an error is encountered, else continue.
               (Not fully implemented yet, but works with -E)

                   Special Output Formats and operations

  -TGGS[fmt]  - Write GGS files (needs two columns of data) Fixed format.
                fmt is the format for the numeric fields                   [f10.6,f10.4]
                Should be appended to a pre-existing header using -wa
                see Example 18.
                How to read GGS files, see Example 19.

  -TGGP[fmt- Write GGP files. Fixed format. Not really complete yet, gaps formatted o.k.???
                fmt is the format for the numeric fields                    [f10.6,f10.4]
                Should be appended to a pre-existing header using -wa 

  -TAPL       - special output format Air Pressure Loading, 3-column mc-file.
.................tslist apls/OLKI_apl.ts -LRADI -LEAST -LNORTH -TAPL

  -TEPH site - special output format EPHEDISP, 3-column mc-file.

             - To Cartesian. Converts from polar (amplitude and phase)
               to X Y. Angle a is subtracted from the angle in the file.
               On output, the columns i j can be understood as east and north
           D - angles in the file (and a) are given in degrees                   [radian]
           A - Azimuth is reckoned clockwise from north.
           W - windrose definition; transforms wind direction into
               velocity components. Azimuth is reckoned clockwise
from north.
#i,#j] - amplitude from column i and phase from column j                      [1,2]
               Example: Columns containing

           1      1.000     0.000
           2      1.000    45.000
           3      1.000    90.000
           4      1.000   135.000
           5      1.000   180.000
                    listed with option -TCDA results in
           1      0.000     1.000
           2      0.707     0.707
           3      1.000     0.000
           4      0.707    -0.707
           5      0.000    -1.000
                    (command used: tslist -LR -LA -Ni -n -F2f10.3 )

  -TROT[R]a[:ic1,ic2] - rotate with angle a, column ic1 is x-, ic2 is y-component   [1,2]
           R - angle is in units of radians                                     [degrees]


             - special case: If you retrieve a 3-column mc X,Y,Z-file, the
               output is transformed to R,E,N at the indicated location
               (lat,lon) or (X,Y,Z) (which is decided upon the number of
               commas in the string
               N.B. you must retrieve the columns in the order X,Y,Z, e.g.
.................tslist ib.ts -LX -LY -L'Z],Rwd$' -F3d12.4 -TRF-71.,42.4 -TAPL
Instead of numbers, inject the -TRFlon,lat using xyz2lola: e.g.
-TRF`xyz2lola ONSA`
With -TRFD input 3 more columns with uncertainties (sqrt of the
               diagonal elements of the variance-covariance matrix)
               With -TRFF input 6 more columns with the full variance-covariance
               information (in the order SIG11 22 33 12 13 23)

             - the inverse of the above. Try this:
                 tslist WW/ONSALA60_apl.ts -LR -LE -LN -F3f10.5 \
                        -TRFI`~/gps/bin/ssc2lola en , ONSA`

  -TRF[D][I]Tlon,lat  - in both cases, the trailing T option initiates a test:
               input = 3 rows, [1,0,0] [0,1,0] and [0,0,1]
               instead of real data. However, the mc-file must be read.

  -CCVa,b    - Output Cross-covariance between the columns a and b
               (Output series will be twice as long)
               Output is in columns 1 and 2, value and count, respectively.
               The value is divided by the length of the series.
               The count is also divided by the length of the series.


               Alternatives: ASCII and Binary
  -w[a] filename                    -
ASCII output to a file on unit 8.
                                      The print options above apply.
a for append

               Binary output to a file on unit 31. The following
               modifications are possible:
  -OEA                              - option to suppress writing of leading
                                      missing-records, will adjust the epoch data
                                      written in the file header.

  -oo                               - binary output into (over!) input file

  -o[c] filename                    - binary output file. Overwrite.
                                      If filename = % the input file name is used (!)
                                      The column to be output can be specified by c.
                                      Default c = 1

  -O[c][:label[,comment]] filename  - binary output file. Append.
-OO[c][:label[,comment]]             input file name is used (!)
                                      (If input is in ASCII or if only internally
                                      generated data is used, option will be declined)
  -O[c]:label[;comment] filename
  -o[c]:label[;comment] filename
                                    - adds a comment to the label.
                                      Labelled output implies append
                                      The label option is utilised for locating
                                      file sections in multi-component files

                                      For multicolumn output in one sweep, this form
                                      can be repeated, delimiter='|', as follows:

  -O[c]:= filename                  - If the label is "=", the label last read
                                      from the input file is copied to the output.

  -O[c]:label: filename             - The colon will be replaced by the comment part
                                      of the label that was read last from the input file

               Labels are normally 16 characters long; words are separated by `_´ and
              `_´ should be used to fill the label. A two-word label can be generated
               using e.g. `label a,b` (returns  a______________b ).

               The use of comments with labels is deprecated at the moment.

               -ofilename (no blank) is obsolete and non-functional since March 2004.

               filename given as `%´ indicates that output is to the input file.
               That may lead to adverse results.
               Careful when adding columns to the same file!


All file input uses units 21 (...30). 

We distinguish between ASCII input and binary input.

A column in an MC-file is retrieved by means of a label

First general input options, then binary input, then ASCII input in a separate chapter.

  -ffilename - A way to specify a file name late on the line.

  -f filename  will also work.

  -sxn       - shift the time series by n samples. Additive to ...
  -s[f][s]d  - shift the time series (absolute or relative)
               i.e. the origin time (t0) is set to  d ( - t0 ) and the samples
               up to this date are shifted out.

       f = f - shift with respect to time of first sample (subtract t0)
       f = o - shift time on output only. Affetcs ASCII and BIN output.

               else: shift absolute with the indicated amount.
               Positive values will shift the series to earlier times.
       s = t   d is given as h[,m[,s[,ms]]]
       s = d   d is given in days
       s = h   d is given in hours
       s = m   d is given in minutes
       s = s   d is given in seconds
               else d is given in amount of samples (integer)
               The shift in units of time is cumulative.
               -sfd5 -st3,10,10  shifts the time series ahead by
               5 days plus 3h 10m 10 s relative to t0
               (one specification of the f-option is sufficient.)
               This is particularly useful when series must be aligned
               to the same t0 
               or the particluar series has that many
               missing records at the beginning.


  tslist fileA [-LlabelA1 -LlabelA2 ... ] [ -# fileB ... ] [ -#L fileC -LlabelC1 ...]

  -# file    - open another input file, read into the next available column.
               Label parameters, if given, will pertain to the file specified
               closest to the left (fileA in the example above)

  -#Mf,n,o file
             - Do 'label math' with this file, see -ML below.

  -#L file -Llabel1 -Llabel2 ...
               open another input file, expect label parameters to the right

               The maximum amount of columns must not exceed 10;
               an unlabeled file is counted like a label.

               A range of single-column files can only be processed in a meaningful way
               if their starting times, lengths, and sampling intervals are identical.

  -%         - open binary file with CONVERT='BIG_ENDIAN'
               Default is LITTLE_ENDIAN.

  -lcode     - Process MC-data (multi-component (a.k.a. multi-column)
               with labeled sections).

               code specifies location string
               Specify -l' '  to obtain a list of the location codes
               of the file.

               Load more than one file section by specifying a series of
               location strings in the order of the columns to appear on the
               output. In this case the output format must be extended. If
               n columns are to be retrieved and printed, -Fformatcode
               where formatcode is Fortran format code for n columns, e.g.

               A leeding, unique substring suffices. Thus,
               -lR will find RADIAL. A '|' followed by another search substring 
               can be used to create short, unique location strings. Thus,
               -l'N|S' will find the segment labelled NORTH__SIGMA (obs quotes
               to avoid shell interpretation of |).
               A trailing ]Rwd may be useful, if more than one segment is to
               be printed; e.g. -lE -lR]Rwd -F2F10.3 to print the segments
               labeled EAST and RADIAL, when RADIAL is first in the file.

               More explanations here and in ~/sas/p/tss.f,
               integer function loc_getts_mc
               The second column may often be used for data uncertainty.
               The scale parameter (-Sscale) applies to the first,
               second and following columns; all other editing etc. is
               carried out only on the first column.

  -LCODE     - like -lcode; however, the file labels are converted to
               upper case before they are compared with CODE.

  -L* -L*],Rwd - This sequence sends a copy of a file into two columns. (Beware to code '*'
                 or set noglob), 

  -MLf,n,o:CODE - "Label maths", arithmetics with the actual MC-input data:
               add, subtract, multiply or devide ( o = a
| s | m | d ) channel n with
               f times the input series. Additional arithmetics: o = q
| r for
               square-sum and root-square-sum.


There is an important convention with ASCII input..
Concerning duplicate records. By default we assume that records that appear later on the input are more credible than earlier ones.
If this is not the case, specify the O- option after the format specifier under -g. See there.

  -A[>target]] - ascii data.                                                      [binary]
               Target string (cf /sas/readfmd.f parameter trg).                     [none]
               The colon might be needed if the first character
               of the target is 'U'
-A'>BRX]'    Special file format: BRX - old tidal sub-day records.
-A'>SAC]'    Special file format: SAC - ASCII seismic SAC file

OBS! The '>' is mandatory now, -A: is deprecated. -A (no target) still o.k.
New option -Afile... see -E
Change made on 2013-04-22

  -at[]o]    - initial move to a file location by search-target t                   [none]  
Reading will start after this line unless option includes B
               o - option string to qloc_in_file. Default 'AN' means:               ['AN']

                   target anywhere on the line, max. one rewind.
                   Specify 'ANB' if backspace is desired.                                               

  -AU[target]]  - irregular ascii data; employs the abscissa-and-ordinate input
               routine Read_Fm_U followed by a call to a regularisation algorithm.
               Use the following options to specify modifiers for the regularisation:
...............Gaussian interpolation:

. -uwwidth   - width of sample search in units of dt                                   [1]
  -ussigma   - Gaussian bell width in units of dt.                                     [1]

...............Spread ("extirpolation", Numerical Recipes, Press et al., Chap. 13.8)
  -umnumber  - number of samples to be affected                                     [5]
  -um          selects the spread method; the Gaussian method is the default.
               Use the -r option to define dt. Use the -0 option to define t0.

               The -U option can be used to specify the desired
               length of the data series.                                           [none]

  -sD[date]  - "sine diem", the file has no year-month-day information.
               The string date is to be added before the time column.
               A dummy character field must be reserved in the -g'(format)',
               and hour-minute-second-depth (-k option) must at least be 1:
               e.g. -g'(a1,t1,f10.1,f10.4)' -k1                                 [2000,1,1]
...............See example 12

  -sn        - skip the first n records                                                [0]
  -sln       - keep the last n records
  -s[f]s     - no effect in ascii-input. Use -B !
  -ecode     - end-of-file target string.

  -gu>[#v]   - binary files: change missing records to value v.                      [0.0]

  -gtsf[:c]  - A shorthand to input column number c from one of our most common
               ascii formats,
               -gi4,2i3,i4,2i3,tj,e12.0 -k3
               where j=37+12(c-1)]                                                     [1]

             - format code and eventually options for input
               Option > must be coded last,
          #v - change missing records to value v.                                    [0.0]

               Special conventions exists for BRX data files. For the normal
               case, i.e. reading with read_fm_d, the following applies:
    code       signifies a fortran format expression. If a leading
               left parenthesis is missing, code will be enclosed by a pair of
               parentheses automatically.

               Additional options can be given after the closing parenthesis.

               The format expression must comprise:
               the date and time part and the sampled parameter part.
               The read_fm_d convention is that each record contains one of each
               part (date can be supplied once for all from the call line, see
               the -sd option, time can be skipped, -k0).
               The date part can signify a string (subsequently converted using
               the -d option), a floating point number (Julian date,
               decimal year) or three integer values; the latter is the default.
               The time part may be zero to four integer fields deep depending
               upon whether hour, minute, second and fractional seconds are
               to be read from the file (see -k# option; the default assumption
               is that the hour field is to be input.

    opt        Some options concerning the reading and the interpretation of
               the time record can be passed via code after the closing ')',
               cf proc_f_on_rec / urtapu13.f 

               Y2K: Your year values might have two digits only. Then you can append
         ,Y2K  after the closing parenthesis. You can specify a turn-over year
               Example: -g'(i2,2i3),Y2K=10'
               with which you can read dates from 1911 to 2010

               JULIAN? read_fm_d analyses the format string. If it finds an f format
               descriptor before any i, it will assume Julian days. Modifications
               of Julian date can be indicated after the closing parenthesis.
               Also, if the time record consists of decimal years, this has to
               be declared after the closing parenthesis. Consult read_fuf.

          ,O - This option means "overstoring = false", i.e. records of the same date
               that occur later on the input stream do not replace records already
               input. The default is "overstoring = true". To re-instate specify

               N.B. In tslist floating-point time records are always to be associated
               with the Fortran format descriptor 'F'. With input operations all
               three decimal floating-point descriptors ( 'F' 'E' 'D' ) appear
               to give identical results. I might miss some subtilities here.
               See example 11 below.

               Free-format input is possible. Format code='*'
               Variants: Julian days or decimal years: '*f)' resp  '*f)Y=1992]'
...............alpha-months, '*a[#n][,delim])'
               where the width of the alphameric field can be given (#n)
               and optionally a delimiter that separates the date part from
               the time and sampled parameter parts. The search for the
               delimiter starts in that case after the n'th column.
               There will be examples one pretty day.

  -dcode     - date format for converted string (months 3-letter code
               converted to numeric form), after conversion.
               Free-format input is allowed, code='*'                    ['(i4,i3,i2)']

  -TZ#h      - The ITZ (time-zone) parameter. Floating-point values can
               be specified.                                                        [0]
  -TLS       - Exact leap-second processing                                        [no]

  -k#k          - read_fm_d parameter k = `khms´ indicating
                  hour minute second frac.sec. record depth (1..4)                  [1]

  -y[#y]        - For input=decimal years, -g'(f...,)' needed. Implies -k0 .
                  -k#k must be issued after -y if nonzero `khms´ is desired.
                  y (integer) sets the reference year for input and print        [2000]

  -v            - Time duplicates are dropped. Default is that they replace the
                  sample previously read in.

  -r[u]#dt      - dt - sampling interval).
                  u - units are days (-rd), hours (-r or -rh),
                  seconds (-rs) or minutes (-rm).

  -0[x|r][u]#h  - ( `zero´ !)   Set start time 
                  h -
(first sample time offset)                                [
                  This is the lag of the first sample after the epoch at midnight.
                  u - see explanations under -r  

                  In conjunction with ASCII input:

       -0x[u]#h - Set file start at exactly h hours (seconds) after epoch .
                  Else: round starting time to specified value, still detect
                  file start from first record date.
                  If the first file record hasn't the earliest date, a suitable
                  starting date must be defined using -By,m,d and the -0x option
                  must be used.
                  If -0... is used, -r...  must also be given.

                  In conjuntion with binary input:
       -0r[u]#h - round the file time (after epoch) to h hours (or seconds)
                                                                          [1.0d0 (hour)]
        -0[u]#h - set the file time to this hour (or second)                     [0.0d0]

  -z#v[,#t]     - ASCII-input missing-record symbol.                  [-99999.0d0,1.0d0]

This is a sub-mode to ASCII. The files that are read contain typically hourly records in the principal scheme

STATION/INSTRUMENT/CHANNEL year month day seg  x1  x2  x3  ... xq

where seg is a segment number indicating the first or the second half of the day,
and x1 ... xq are 12 samples. Divisions into segments of length 6 or 8 are also possible.
The reading routine that is used for this data type is read_brx (readbrx.f)
The ambition with  read_brx  is that the record part up to and including seg is handeled
with hard-wired programming according to a fixed number of options, and the parameter sample
format can be specified at run-time.

  (for clarity the stipulated characters are underligned. Also see Example (7) below.
    Note: in the unix shell the ) character must be quoted.)

  -ABRX     - switch to this mode


      numfmt is the format code applying to one parameter sample.

numfmt default
Joint Archive for Sea Level F5.0
HYCON, 4 sub-daily records
Bruxelles, incl. the so-called jump-cards

back to ASCII

Common mistakes:
With Julian date input one easily forgets -k0

ASCII data -A with target positioning: -Atarget  or  -A -atarget
Second form needs -A while target can occur anywhere on a line
A -a alone will cause jump to the second input line!


 (1)  You have formatted data, decimal years (*.ep):

       tslist $DDIR/ -g'(1x,f11.6,t13,f10.3)Y:1992' -k0 -C1 -Ff12.2 -012 -r24

     the last two options (-0time and -rrate)  may be necessary if some of the first three
     samples are missing. And to set the reference exact.
          The -C1 option requests printing of calendar form with width + 1, i.e.
     year month day hour . This might be useful to check that the date conversion is accurate enough.

 (1')    Making mc-files out of data like this:

       tslist $DDIR/ -g'(1x,f11.6,t13,f10.3)Y:1992' -k0 -I -012 -r24 \
       tslist $DDIR/ -g'(1x,f11.6,t33,f10.3)Y:1992' -k0 -I -012 -r24 \
       tslist $DDIR/ -g'(1x,f11.6,t53,f10.3)Y:1992' -k0 -I -012 -r24 \
       tslist $DDIR/ -g'(1x,f11.6,t23,f10.3)Y:1992' -k0 -I -012 -r24 \
       tslist $DDIR/ -g'(1x,f11.6,t43,f10.3)Y:1992' -k0 -I -012 -r24 \
       tslist $DDIR/ -g'(1x,f11.6,t63,f10.3)Y:1992' -k0 -I -012 -r24 \

     To retrieve one of these segments,
       tslist ONSA_gd.ts -L'EAS|VAL' -Ff12.2 -C1

Modified Julian dates:

    50083.00     .00499    .00004    .00015
    50083.25     .00451    .00009   -.00008
    50083.50     .00513    .00021   -.00044
    50083.75     .00466   -.00024   -.00066
    50084.00     .00407   -.00052   -.00045

tslist datafile -A -g'(f12.2,1x,3f10.4),MJD:' -k0 -C1

    Reduced Julian Date: specify ,RJD:

  (2)  You have formatted data

 (2')  Slightly more complicated: You have formatted data, yet (nearly-)free format input of records like
     1997 sep 17 14 00 00 1.23456

       tslist data.tsf -A -k3 -g'*a11)' -J -Etest.tse,TEST]

     while test.tse may look like
     DELETE At 1997 09 17 15 0 0 0

 (3)  You have not really a time-series, rather a set of positional data (a vector); records like
     1      6.4843E-01   .0000E+00
     2      8.2342E-01   .0000E+00
     3      7.4881E-01   .0000E+00

       tslist UMEA-res.dat -g'(f6.0,6x,f10.0)' -r24 -J -k0 -00. -TZ-12

 (4)   You have an undated time series; time record is in decimal hours from a certain epoch.
     22.0000       .5395     10.9354     -3.5522
     23.0000     -1.2805      6.8930     -1.8882
     24.0000     -2.7594      1.3339       .2259
     25.0000     -3.5621     -4.3536      2.2552
     26.0000     -3.5251     -8.7694      3.6889

     Let the epoch be 1998-02-02 as an example.

        awk '{print "1998 02 02",$0}' gel-stra.dat | tslist - -g'(i4,2i3,2x,2f12.0)DH+]' -C


     1998 02 02  22   50846.916667   .53950
     1998 02 02  23   50846.958333 -1.28050
     1998 02 03  00   50847.000000 -2.75940
     1998 02 03  01   50847.041667 -3.56210
     1998 02 03  02   50847.083333 -3.52510

     Next on the wish-list: linear transformation of a general floating record to get floating point hours

   (4')  You know the year and you have Day-of-Year records (e.g. DOY=154)

     154073003 1015.3
     154073008 1015.4
     154080003 1015.7
     154080008 1015.6
      ... (file name  test.tsf)

     We'll utilize that  read_fm_d  switches to DOY-mode if the month is specified as zero.

        awk '{print "1993 00",$0}' test.tsf |\
         tslist - -A -g'(i4,i3,i4,2i2,2x,f10.1)' -k2 -00. -r1. -Ff10.1 -C1

 (5)   One-minute data without time tags, to be decimated to one-hour data.
     Missing samples are symbolized by 999999. The interesting data is in
     column 2. (/geo/hgs/SIVS/data - Iceland vol-strain gauge)

       awk '{r=NR-int(NR/60)*60; \
             printf "1997 10 01 %3d %3d %6.1f\n ",\
             int(NR/60),r, $2}' 1997-10-min |\

         tslist - -g'(i5,2i3,2i4,f10.0)' -k2 -oska-1h.ts -I \
                -z999999.0 -rs60. -Em2h.tse,M]

     where the file m2h.tse contains

     DECI 60 S=121

 (6)  GPS PPP time series
     The problem is here that there are some records at precise hour whereas the ones we'd use are
     issued at 5 minutes after the hour. We first need a suitable start time.
        cal2sec 1997 1 1 0 0 0
     gives  -94651200.0

     There were a couple of bad records. This one removes all records starting with `0.0u':

        awk -v s=-94651200.0 \
            '\!/^0.0u.*/{if (NR>2)
             {printf "1997 01 01 %15.6f %s\n",($1-s)/3600,$0}}' \
            wtide.WES2_15 >! wtide.wes2

     After this transfer, a binary MC file can be made:

        rm -f
        tslist wtide.wes2 -g'(i4,2i3,f16.6,t74,f13.0)DH+]' \
               -E,WES2_R] -r1. -k2 -I -O:RADIAL_______VAL
        tslist wtide.wes2 -g'(i4,2i3,f16.6,t90,f10.0)DH+]' \
                          -r1. -k2 -I -O:RADIAL_______SIG

     with editing file tslist.tse

     DEL > 0.1 ALL

     SCALE 111.0e3
     DEL > 0.1 ALL

     SCALE 150978.
     DEL > 0.1 ALL

 (7)  Joint Archive for Sea Level (JASL) time series

         tslist h275a95.dat -ABRX -g=':JA)' -FF10.3 -S0.001

     notice carefully the use of the BRX read routine (~hgs/sas/p/readbrx.f) and how the format group
     JA (for Joint Archive) is entered. Result will be in metres.

 (8)  NOAA/NOS tide gauge time series:

         tslist boston-tgg-obs.dat -A'<B>Station]' \
                -s1 -g'(13x,i4,4(1x,i2),f8.0)' \

                -k2 -C2 -I -oboston-tgg-obs.ts

 (9)   Use with GMT:
     Try first
         tslist $TAPDIR/ONSA.ra.wr.ts -t2,5/4,8/f:12,5
         -R1992./2000./-8.000/4.000 -Ba2.000f.1667/a2.000f.4000

     Then apply in psxy:
       tslist $TAPDIR/ONSA.ra.wr.ts -qq |\
          psxy `tslist $TAPDIR/ONSA.ra.wr.ts -t2,5/4,8/f:12,5`\
            -JX6/3 -M -W2/0 -K -O >> $psout

     To insert axis text, do
.........bobt=`tslist $TAPDIR/ONSA.ra.wr.ts -tt2,5/4,8/f:12,5`
.........bobt=`echo ${bobt}":Y-axis label:"WeSn | sed 's|/|:X-axis label:/|'`
...........tslist $TAPDIR/ONSA.ra.wr.ts -qq |\
.............psxy `tslist $TAPDIR/ONSA.ra.wr.ts -tr2,5/4,8/f:12,5` \
...............$bobt -JX6/3 -M -W2/0 -K -O >> $psout

     or, which is equivalent,
.........tslist $TAPDIR/ONSA.ra.wr.ts -qq |\
...........psxy `tslist $TAPDIR/ONSA.ra.wr.ts -tt2,5/4,8/f:12,5 |\
.............sed 's|/|:Y-axis label:/|; s|$|:X-axis label:WsEn|'` \
............. .-JX6/3 -M -W2/0 -K -O >> $psout

 (10)  A typical air pressure effect - time series reading:

                 fgrep TOKYO /home/hgs/Oload/smhi/keystone-apl/local.pressure |\
          tslist - -A -g'(t6,a9,1x,i2,t31,f10.0)' -d'(i4,i3,i2)' -k1 -Ff12.4

 (11)  A typical Lubo-file from matlab, time record specifies days after some given date
        Example is for days after 1993 01 01
           2.3100000e+02   1.3349500e-01   1.3349500e-02
           2.3150000e+02   1.1365900e-01   1.1365900e-02

        JDC -d -m 1993 01 01

          tslist SUND_rs.dat -A -g'(2f16.0)J+48998' \
                 -r24. -k0 -mL -o SUND_rs_24.ts

        Second example prepares a data set with time record in Lubo's
        decimal years (365.0 days)
  in the same format as SUND_wet.dat above:

          awk '{printf "%16.7e%16.7e%16.7e\n",($1-1993)*365,$2,$3}' \
              /wvr2/SanFra/Matlab/SUND_wet.dat > ! /Bifrost/hgs/wet/SUND_wet.dat

 (12) Year-month-day part is missing
      Assume time is meant to mean 6 minutes intervals

            awk 'BEGIN{for(i=0;i<11;i++){printf "%10.1f %10.4f\n", i,1+i/10}}' |\
                tslist - -A -g'(a1,t1,2f10.0)DH+0,10.,SD=1999-1-1]' -k1 -C2
       or               ...   |\
                tslist - -A -g'(a1,t1,2f10.0)DH+0,10.' -C2 -sD1999-1-1

       result of awk:
       0.0     1.0000
       1.0     1.1000
       2.0     1.2000
       3.0     1.3000
       4.0     1.4000
       5.0     1.5000
       6.0     1.6000
       7.0     1.7000
       8.0     1.8000
       9.0     1.9000
      10.0     2.0000

      Output data:
1999 01 01  00 00   51179.000000  1.00000
1999 01 01  00 06   51179.004167  1.10000
1999 01 01  00 12   51179.008333  1.20000
1999 01 01  00 18   51179.012500  1.30000
1999 01 01  00 24   51179.016667  1.40000
1999 01 01  00 30   51179.020833  1.50000
1999 01 01  00 36   51179.025000  1.60000
1999 01 01  00 42   51179.029167  1.70000
1999 01 01  00 48   51179.033333  1.80000
1999 01 01  00 54   51179.037500  1.90000
1999 01 01  01 00   51179.041667  2.00000

      'DH+0,10.0' added to format means: decimal hour, offset 0, scale 1/10 = 0.1 h = 6 min
      A dummy date string is read from the file and replaced by the base date. Therefore
      -k1 -g'(a1,t1,...)' Observe that -k1 is the default.
      -sd1991-1-1 introduces the base date.

           ... |  tslist - -A -g'(a1,t1,2f10.0)' -sd -C2
      takes elegantly care of that file, using the defaults: date 2000,1,1 and
      time increment one hour.

 (13) Irregularly spaced data:

      cd ~/g/Bohotide/Data/
      tslist $fn -AUcm] -g'(6i2,f10.0)' -k3 -Ff10.3 -TZ1 -C3 -01. -r2. -uw2. -I -o ../$sect.ts

      Input data:
      setenv fn KI0023B_1.mio
      setenv sect KI0023B_1
      m ~/g/Bohotide/Data/KI0023B_1.mio
l 16
;REPORT KI0023B_1  generated 01/01/24 15:13:55
cu MD31  kPa
cm time 980212000000   010101000000
980216100833  4270.541
980216110705  4267.679
980216120000  4267.472
980216123328  4267.472
980216130631  4267.472
980216140000  4267.27
980216160000  4266.861
980216180000  4267.472

 (14)  Moving-average smoothing

      setenv MA_LENGTH 11  # for example
      tslist file.ts -E'~/gps/movave.tse,MA]'

(15)   How to list breaks: -MB

      tslist SESHAN25_apl.ts -MB -C1
1997 09 01  00                 50692.000000 BEGIN FILE
2000 10 01  00                 51818.000000 BEGIN BREAK
2001 01 01  00                 51910.000000
2001 12 31  18                 52274.750000 END FILE

 (16)  Noises

      tslist +1440,-13,0.9,G -rs60 -00 -B1998,12,6

generates a Gauss-Markov time series, one sample for every minute
on Santa Claus day 1998, with seed 13. Markov parameter 0.9 meaning
x(t)=x(t-1)*m + Gauss

      tslist +1440,-13,0.9,G -rs60 -00 -B1998,12,6 -YRND-21,0.1,G

adds Gaussian white noise with amplitude 0.1 to the first series

      tslist +1440,-13,0.9,G -rs60 -00 -B1998,12,6 -YGMN-21,0.4,0.1

adds Gauss-Markov noise with Markov parameter 0.4 to the first series.

      tslist +1440,-13,1.5,F -rs60 -00 -B1998,12,6

generates a fractal noise time series with an ~ f -1.5 power spectrum.

(17)   Label gymnastics

Make a string consisting of the labels of an mc-file to re-use for output to a second mc-file

    set olabs=`tslist o/ -L | awk '/LocGMc/{i++;printf "%s|",i":"substr($3,7)}'`

Make an array of retrieving labels to get all available columns into memory

    set labels= ( `tslist o/ -L | awk '/LocGMc/{print "-L"substr($3,7)}'` )

Then, e.g. the following tslist commands will synchronize all columns with respect to valid data,
contract the gaps, and produce a file (the time information in which will be deliberately wrong)

    tslist o/ $labels -F1p,5d12.4 -MSYNCON -C3 -I -o$olabs

(18)   GGS files output

tslist file ... -O:`label GRAV,VAL`
tslist file ... -O:`label BARO,VAL`
tslist -TGGS -L'G|V' -L'B|V' -qqq -wa GGS/OS100300.GGS

77777777            0.000000
20100301 000000  -0.2060873   982.4010
20100301 000001  -0.2054710   982.3980
20100301 000002  -0.2060370   982.4010
20100301 000003  -0.2082918   982.4020
20100301 000004  -0.2102593   982.3980
20100301 000005  -0.2095818   982.4010

(19)   GGS files input

tslist OS100300.GGS -g'(i4,2i2,i3,2i2,f12.0),WOX:1,777777]' -k3 -A77777777] -e99999999 -I -rs1.

The format for accessing the barometer column: Replace f12.0 with 12x,f11.0
WOX:1,77777777]   is used to skip all records that have a gap signal in column 1 -
- tslist manages gaps anyway.
-A77777777] is used to poition the file, which occurs in MAIN before READ_FM_D is called.
-e99999999 defines the EOF-mark. Without this definition the procedure decodes the mark as a date.
It's stubborn and stupid, I know.

(20)   GGP files input

The options suitable for the files we send to Potsdam are lengthy. Do it like this:

set ggp = ( -a77777777 -g'(i4,2i2,i3,i2,t16,f10.0),EOF:99999999],WO:88888888,WO:77777777' -k2 -rs60 )
tslist ~/www/4GGP/GGP/OS130900.GGP $ggp -I -o tmp/ggp.ts

(21) A sequence of periodograms
We request 24 periodograms from one day of 1-second gravity residual.
We de
monstrate the use of the -sf option, which is the only way to move the origin of a time series within the array.

foreach i ( `fromto -f'%2.2i ' 0 23` )
 tslist d/ -qqq -L'G|R' -N1p,e12.4 \
       -nf2.777777777777778E-004 -sfh${i}.0 -F1p,e12.4 \
       -Epdgram.tse,1H -w o/G1_gar_100628-1s.${i}.pdg

with pdgram.tse
FILTER 0 1 ' '
1.0 -1.0

In the same file there is a HANN-window version to this too. Notice that the tse-file is simple and invariable.

We could subtract the barometric effects with
tslist d/ -qqq -L'G|R' -ML3.156,1,a:'B|V],Rwd' \
      -N1p,e12.4 -nf2.777777777777778E-004 -sfh${i}.0 \
      -F1p,2e12.4 -E1,2:pdgram.tse,1H -w o/G1_gar_100628-1s.${i}.pdg

-w without the -p option always outputs all columns - it's the first column that is pressure-reduced.

Find out the frequency step with
tslist d/ -qqq -Epdgram.tse,1H -N1p,e12.4 -ni-1 -F1p,e12.4 -I |\
       awk '/Spectrum\:/&&/FNy/{print $9}'

The time field option can also be coded as -n/3600 , something we could have guessed.

To make a nice plot, consider
rastersp -x0,0.5,100 -y-100,100,100 -w o/G1_gar_100628-1s.ras.pdg \
         -R o/G1_gar_100628-1s.??.pdg

cd plot
source rastered-pdg.env

but edit it to fit your requirements. An appropriate xyz2grd command is printed as the bottom line of rastersp.

(22) ASCII file with a number of columns, input in one job.

The example is for a file with three data columns.

tslist data.tsf -gi4,3i3,f10.0 -k1 -r1 -p3 -E2:input.tse,I2 -E3:input.tse,I3
(annoying feature: we have to anticipate the 1-h sampling time: -r1 )
The tsf-edit file input.tse  is
OPEN 41 R data.tsf
OPEN 41 R data.tsf

Where are we ?

Get a golden badge