   Specifications of MMF_STAT format.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   MMF_STAT format is for distribution statistics of the MMF mapping
   function as a function of elevation. For each station, for each
   discrete elevation four statistics are computed that are function
   of time in the form av + ac*cos(sa_frq*tim) + as*sin(sa_frq*tim) where 
      av     -- average value
      ac     -- cosine annual amplitude
      as     -- sine annual amplitude
      sa_frq -- annual frequency  ( 1.990968752920D-07 rad/s )
      tim    -- time from the J2000.0 epoch in seconds.
  
   The statistics is the rms of residuals after fitting the zenith
   path delay and tilt of the local atmosphere symmetry axis to the sum
   of predicted non-hydrostatic path delay and the residual hydrostatic
   path delay after subtraction of hydrostatic mapping function scaled to 
   the hydrostatic path delay from the numerical weather model. The MMF
   non-hydrostatic mapping function is used for computing partial derivatives.
  

1) Header record -- the first record should have a signature:
                    # MMF_STAT  Format of 2008.09.25

                    The header record allows to distinguish a valid
                    file in the MMF_STAT format from files
                    in other formats.

2) N-record section
   N-record defines the number of stations and the number of elevations.


3) S-record section
   S-record  defines a name and coordinates of each site. 
   A site cannot be defined more than once.

4) E-record section
   E-record defines the array of discrete elevation angles.


5) R-record section
   R-record defines the four statistics for a given station and 
   a given elevation.

6) Trailer record -- the last record is the same as the header record.


Format of an N-record:
----------------------

Field   1:1   A1    -- Record ID. Should be letter N (decimal code 78).
field   2:3   a2       delimiter: blanks.
Field   4:7   I4    -- the number of stations
field   2:3   a2       delimiter: blanks.
Field  10:13  I4    -- the number of elevations


Format of an S-record:
----------------------

Field  1:1   A1    -- Record ID. Should be letter S (decimal code 83).
field  2:2   a1       delimiter: blanks.
Field  4:11  A8    -- 8-letter long site identifier. May contain
                      any characters with decimal codes 32-255, but
                      blanks are allowed only at the end of the site
                      identifier. This site identifier should be unique
                      among S-records. This field should not
                      necessarily have a special meaning. Parsing
                      software should not try to interpret it.
field 12:13  a2       delimiter: blanks.
Field 14:26  F13.4 -- X site coordinate in a crust fixed reference
                      frame. Units: meters.
field 27:27  a1       delimiter: blank.
Field 28:40  F13.4 -- Y site coordinate in a crust fixed reference
                      frame. Units: meters.
field 27:27  a1       delimiter: blank.
Field 42:54  F13.4 -- Z site coordinate in a crust fixed reference
                      frame. Units: meters.
field 55:56  a2       delimiter: blanks.
Field 57:64  F8.4  -- Site geocentric latitude, positive to north,
                      in degrees. This field is for information only.
                      Parsing software MUST ignore it.
field 65:65  a1       delimiter: blank.
Field 66:73  F8.4  -- Site longitude, positive towards east,
                      in degrees. This field is for information only.
                      Parsing software MUST ignore it.
field 74:74  a1       delimiter: blank.
Field 75:80  F6.1  -- Site height above the reference ellipsoid in
                      meters. This field is for information only.
                      Parsing software MUST ignore it.


Format of an E-record:
----------------------

Field   1:1   A1    -- Record ID. Should be letter E (decimal code 69).
field   2:3   a2       delimiter: blanks.
Field   4:7   I4    -- Elevation index
field   8:9   a2       delimiter: blanks.
Field  10:17  F8.5  -- Elevation angle in degrees.


Format of an R-record:
----------------------

Field   1:1   A1      -- Record ID. Should be letter R (decimal code 82).
field   2:3   a2         delimiter: blanks.
Field   4:7   I4      -- Station index
field   8:9   a2         delimiter: blanks.
Field  10:13  I4      -- Elevation index
Field  10:17  F8.5    -- Elevation angle in degrees.
field  14:15  a2         delimiter: blanks.
Field  16:23  A8      -- Station name
field  24:25  a2         delimiter: blanks.
Field  26:33  F8.5    -- Elevation angle in degrees.
Field  36:46  1PD11.4 -- Average value of the RMS for the statistics.
field  47:48  a2         delimiter: blanks.
Field  49:59  1PD11.4 -- Cosine amplitude of the RMS for the statistics.
field  60:61  a2         delimiter: blanks.
Field  62:72  1PD11.4 -- Sine amplitude of the RMS for the statistics.

