  1.  NAME

  scan_nbr - Scan NB ADCP raw files

  2.  USAGE

  scan_nbr control_file

  3.  DESCRIPTION

  This utility scans NB ADCP raw files, as described in RDI's Technical
  Manual and generates output files with log information, statistic on
  selected variables and a binary file with variables values. See below
  for the syntax of the control file.

  The aim of running scan_nbr is to control the integrity of the raw
  files, and generate the binary file. The latter can be used later
  within Matlab with script scan_bin.m.

  The log file contains debugging information about configuration or
  bottom tracking changes, as well as bad ensembles. This can be used to
  edit and fix the raw files if necessary.

  4.  PARAMETERS

  The control file must contain the following parameters:

     file_list: file
        Name of a file containing the successive names of NB ADCP raw
        files to scan. This file can contain C-syntax comments.

     out_file: file
        Root name for generated output files.

     year_base: YYYY
        " Year base to use for conversion of time into decimal days.
        Note that since the NB ADCP raw format does not contain year
        information, this parameter should be set to year of data
        collections.

  5.  OPTIONS

  In addition to the parameters listed above, the following options are
  available:

     OPTIONS:
        This key word can be used to improve the clarity of the control
        file and specify the beginning of options. It has no effect.

     error_check_options:
        Select which errors to check. Possible keywords are:

        BIT_Status
           Check the values of the ADCP bit status.
        end
           This keyword is mandatory and closes the selected list of
           selected errors to check.

     config_check_options:
        Specify which configuration changes to look for. Possible
        keywords are:

        output_buffer_size

        velocity_buffer_size

        spectral_width_buffer_size

        echo_intensity_buffer_size

        percent_good_buffer_size

        status_buffer_size

        time_between_pings

        pings_per_ensemble

        number_of_bins

        bin_length

        transmit_pulse_length

        blank_after_transmit

        delay_after_blank

        adcp_config

        signal_noise_threshold

        percent_good_threshold

        end
           This keyword is mandatory and terminates the list of selected
           configuration changes to check.

        In addition, the keyword ALL will select all the keywords
        appearing in the above list. To deselect some specific parame-
        ters, prefix the undesired keyword with character !, i.e. to
        have configuration check on everything except threshold values:

          _________________________________________________________
                        ALL
                        !signal_noise_threshold
                        !percent_good_threshold

          _________________________________________________________

     data_stat_options:
        This option allows to select which statistics to calculate.
        Possible keywords are:

        time_between_ensemble

        heading

        pitch

        roll

        heading_std_dev

        pitch_std_dev

        roll_std_dev

        adcp_temperature

        end
           This keyword is mandatory and terminates the list of selected
           statistics to perform.

        In addition, the keyword ALL will select all the keywords
        appearing in the above list. To deselect some specific parame-
        ters, prefix the undesired keyword with character !.

     data_flag_options:
        Select which flag changes to report in the log file. Possible
        keywords are:

        bottom_tracking

        end
           This keyword is mandatory and terminates the list of selected
           flags to check.

     tilt_offset:
        This option allows to correct for heading and tilt values if
        these are known. It can be followed by one or more of:

        heading= heading_offset

        roll=    roll_offset

        pitch=   pitch_offset

        end
           This keyword is mandatory and terminates the list of selected
           ship's attitude corrections.

        Values must be in degrees. The specified offset is subtracted
        from the measured value to yield the expected correct value.
        These offsets are set to 0.0 by default.

     ascii_log
        If this option is specified, data saved in the binary file will
        be saved in addition in ASCII format into the log file. This
        allows a quick overview over some of the data found in the raw
        files and can also be used as a debugging information. However,
        generated files can be very large.

     end
        This keyword is mandatory and terminates the list of selected
        options.

  6.  TIME RANGES

  To allow a finer tuning of which pings to scan, the control file must
  be terminated by a list of time ranges.  See time_rng(5) for the
  syntax of these.

  7.  OUTPUT FILES

  The following files are generated:

  file.log - log file

  file.sta - statistics

  file.bin - binary data

  where file correspond to the value of parameter out_file.

  8.  AUTHOR

  Pierre Jaccard, Geophysical Institute, University of Bergen, 1999

