/******************************************************************************

  FILE:  adcpsect.cnt

  This control file is used with the adcpsect program
  to extract ADCP data for specified sections along a cruise track
  from a CODAS database, perform the desired calculations,
  and write the result to text and Matlab files.
  The sections are specified as time ranges.

  This particular version is used to extract
  water track velocities into an ASCII text file.

  INPUT:  CODAS database
  OUTPUT: 1. text file (.sub file) with following columns:
             a. time in decimal days
             b. longitude in decimal degrees
             c. latitude in decimal degrees
             d. absolute U-V pairs for each depth layer in the grid
          2. text file of statistics--mean (.sta file)
	  3. Matlab files:
	     a. _uv.mat contains array uv (alternating uv for each layer)
	     b. _xy.mat contains array xyt (lon, lat, time), etc.
-------------------------------------------------------------------------------
  CONTROL FILE STRUCTURE:

  dbname:       < CODAS database name >
  output:       < output filename >
  step_size:    < number of profiles to advance >
  ndepth:       < number of depth bins to read and process >
  time_ranges:  < combined or separate >
  year_base=    < base year for decimal days >

  option_list:
    [ verbose ]                       { prints debugging and auxiliary output }
    [ underway?    < no | yes limit= <3> > ]                   { limit in m/s }
    [ pg_min=      <80> ]
    [ AGC_margin=  <10> ]

    [ skew_limit:
        agc_limit=  <100>
        max_velocity_difference= <0.8> ]                                { m/s }

    [ reference:       { choose only one of the following: }
        < reference_bins <5> to <20> |
          none |
          final_ship_ref |
          nav_position |
          nav_velocity |
          bottom_track |
          dir_position > ]

    [ navigation:      { output in .nav text file }
                       { choose one or more of the ff. then 'end' }
        [reference_bins <5> to <20>] {bin range; first bin is 1}
        [final_ship_ref]
        [nav_position]
        [nav_velocity]
        [bottom_track]
        [dir_position]
        end ]

    [ rotate:  < ship_coordinates | n > ]
        { where <n> is the angle in degrees, old x-axis to new x-axis }

    [ ctd:
        dbname:  < CODAS CTD database name > ]

    [ regrid:
        < integrate | interpolate | centered_average | average |
          per_grid_interval >
        < depth | svan | pot_svan | sigma_theta | sigma_t >
          { one of the last 4 only if the ctd: option has been selected }
        < grid      number= <50> origin= <16> increment= <8> |
          grid_list number= < 5> boundaries: <20> <40> <60> <80> <100> > ]

    [ contour:         { output in .con text file }
        < latitude | longitude | time >
        < middle | mean >
        minimum_npts= <10>
        units=        <0.01> ]

    [ vector:          { output in .vec text file }
        minimum_npts= <10> ]

    [ transport:       { output in .trn text file and _tr.mat Matlab Mat-file }
        minimum_npts= <10>
        units=        <1.e6>                                  { for Sverdrups }
        direction=    < all | left | right | along > ]

    [ sequential_cor:  { output in .cor text file }
        bin_range: <3> to <40> ]  { starting from 1, inclusive }

    [ ascii:           { output in .sub text file } 
        [ minimum_percent= <0.50> ] { %ensembles in time range with good data }
	end ]                       { less than this, mean U/V is set to 99999 }

    [ statistics:      { output in .sta text file }
        [ mean ]
        [ variance ]
        [ extrema ]
        [ norm_extrema ]
        [ indices ]
        [ all ]
        units= <0.01>
        end ]

    [ flag_mask:
        < bit-mask > { bit-mask is any one or more of those defined in
        .              adcpmask.h; these cumulatively indicate which
        .              criteria to consider in flagging profile bins
        .              as bad prior to calculations.  Use this option
        end ]          if you want flagging other than the default ALL_BITS }

    end

  { list of YMDHMS time pairs: }
  < yy/mm/dd hh:mm:ss > to < yy/mm/dd hh:mm:ss >
  .
  .
  .
-----------------------------------------------------------------------------*/

  dbname:             ../demo/adcpdb/ademo
  output:             os     /* must be <= 5 chars. for DOS */
  step_size:          1
  ndepth:             50
  time_ranges:        separate
  year_base=          1993
  option_list:
    pg_min=           30
    reference:        final_ship_ref
    regrid:           interpolate
                      depth
      grid number=    30
        origin=       30
        increment=    10
    ascii:                         
      minimum_percent= 0.50
      end
    statistics:       mean variance extrema
      units=          0.01
      end
    end

/* TimeGrid:
     output: ademo_os.tmg     time_interval: 60.000000    
     time_range:   93/04/09  00:02:00  to  93/04/10  07:36:00
*/
   93/04/09  00:02:00  to  93/04/09  01:02:00
   93/04/09  01:02:00  to  93/04/09  02:02:00
   93/04/09  02:02:00  to  93/04/09  03:02:00
   93/04/09  03:02:00  to  93/04/09  04:02:00
   93/04/09  04:02:00  to  93/04/09  05:02:00
   93/04/09  05:02:00  to  93/04/09  06:02:00
   93/04/09  06:02:00  to  93/04/09  07:02:00
   93/04/09  07:02:00  to  93/04/09  08:02:00
   93/04/09  08:02:00  to  93/04/09  09:02:00
   93/04/09  09:02:00  to  93/04/09  10:02:00
   93/04/09  10:02:00  to  93/04/09  11:02:00
   93/04/09  11:02:00  to  93/04/09  12:02:00
   93/04/09  12:02:00  to  93/04/09  13:02:00
   93/04/09  13:02:00  to  93/04/09  14:02:00
   93/04/09  14:02:00  to  93/04/09  15:02:00
   93/04/09  15:02:00  to  93/04/09  16:02:00
   93/04/09  16:02:00  to  93/04/09  17:02:00
   93/04/09  17:02:00  to  93/04/09  18:02:00
   93/04/09  18:02:00  to  93/04/09  19:02:00
   93/04/09  19:02:00  to  93/04/09  20:02:00
   93/04/09  20:02:00  to  93/04/09  21:02:00
   93/04/09  21:02:00  to  93/04/09  22:02:00
   93/04/09  22:02:00  to  93/04/09  23:02:00
   93/04/09  23:02:00  to  93/04/10  00:02:00
   93/04/10  00:02:00  to  93/04/10  01:02:00
   93/04/10  01:02:00  to  93/04/10  02:02:00
   93/04/10  02:02:00  to  93/04/10  03:02:00
   93/04/10  03:02:00  to  93/04/10  04:02:00
   93/04/10  04:02:00  to  93/04/10  05:02:00
   93/04/10  05:02:00  to  93/04/10  06:02:00
   93/04/10  06:02:00  to  93/04/10  07:02:00
   93/04/10  07:02:00  to  93/04/10  07:36:00
/*****************************************************************************/
