% This directory holds all the programs used for reading binary ADCP data 
% from lowered or shipboard RDI or Sontek instruments.  It also holds 
% programs used in processing data from these sources, including reading 
% and writing binary files from serial ascii inputs, manipulating ADCP 
% data structures.
%
% subdirectory       contents
% ------------       -----------
% rdi, sontek        read binary ADCP data; output is a matlab structure
% utils              manipulate matlab structures from read; including
%                           coordinate transformations, cat and cut structures
% logging            read, write, and manipulate binary data (converted from 
%                           serial data files to binary by "serasc2bin.py"),
% avg_edit           read, edit, and average single pings; write to files for
%                           "ldcodas" to load into a codas database
% codasutils         (utilities in support of avg_edit): conversion from 
%                           matlab data elements to binary suitable for 
%                           "ldcodas" to load into a codas database
% quality            scan raw files (output info about files; part of codas
%                           processing), create heading correction file, 
%                           run quality control on
%                           serial data, peek at raw data 
% uhdas_plot         utilities for grabbing a specific chunk of data, 
%                           plotting for at-sea uhdas web site
% 
% --- rdi, sontek ---
% 
% The basic program necessary to read raw adcp data is "read".
%   - one version of this exists for each distinct instrument type,
%
%    (class)  (description)            (required path, from PATH/matlab)
%     son     (sontek ADP)                  rawadcp/sontek
%      nb     (RDI Narrowband)              rawadcp/rdi
%      bb     (RDI Broadband)               rawadcp/rdi
%      os     (RDI Ocean Surveyor)          rawadcp/rdi
%
%  The different versions are kept separate by using classes, (a subdirectory
%  with the "@" sign in front, in the required path).  NO QUOTES are used
%  when referring to a given instrument class.
%
%  In matlab, do "help os/read" (or nb/read, or bb/read, or son/read) 
%
%--- utils ---
%
% Use these programs are changing between beam, instrument, and earth coords:
%
%      beam_xyz  (transforms beam coordinates into ship coordinates)
%      xyz_enu   (transforms ship coordinates into East, North, Up) 
%      beam_enu  (combines the first two: beam coords to E,N,U)
%
% Use these programs to manipulate matlab data structure from "read":
%
%      catadcp    : concatenate pings from raw data structures
%      cutadcp    : select specific time indices from a raw data structure
%      vcutadcp   : select specific vertical indices from a raw data 
%                       structure,  ** in transition **
%      restruct   : returns easier structure from original read, eg:
%                       data.amp (Nbins x Nbeams x Nprofs) comes back as
%                       dd.amp1, dd.amp2, dd.amp3, dd.amp4, (Nbins x Nprofs)
%
%    chk_rconfig    : compare configs for two raw data structures
%
% -- logging --
%
% These deal with reading and writing rbin files:
%
%    read_bin       : write [rows X N] array along with names (in a structure)
%    write_bin      : read (file written by write_bin)
%    r_row          : returns the rbin row number for that variable
%    tr2ilist       : return a cellarray with files and times of rbin files, 
%                         OR use use that same structure and a time range 
%                         to get rbin data from within that time range
%    get_serfields  : read data from gbin files to augment raw data
%    guess_rfilelist: guess a subset of *.raw files to read based on 
%                        dday range
%    mk_gbin.m      : update gbin files 
%    get_rndata.m   : "get raw+navigation" data structure, suitable
%                        for exploration on the commandline
%
%--- avg_edit ---
%
% Programs for averaging, editing, and writing to disk (in a format 
% suitable for "ldcodas" to load into a codas database are here: 
%
%    get_pedefaults : returns pingedit defaults based on instrument class 
%                         (son, nb, bb, os) and pign type ('son', 'bb', 'nb')
%    prepedit       : flag amplitude outliers and bottom first (pre-pingedit)
%    pingedit       : the actual pingediting.
%    fix_timestamps : (along with unscootch, get_besttime): deal with 
%                        timestamps
%    load_raw.m     : batch processing to get ensembles ready to be loaded
%                        into a codas database (note: "load_avg" is in the
%                        rdi directory because those averages are from VmDAS
%--- codasutils ---
% 
% Programs used to create the codas database are in codasutils, such as
%   to_signed, mk_config1, mk_ancil1, mk_ancil2...
%        
%--- quality --
%
%  Programs relating to overview or quality control:
%
%        scan       : reads files and gets ensemble info; optional: can
%                       use gbin files 
%   
%    qc_rbin        : holds qc info for the rbin files (eg. posmv GAMS flag)
%    configstr      : make a string from config information (eg. for a label)
%   mk_gyrodh       : make ash-gyro (or other heading source) correction
%   rlookit,etc     : quickie raw plots
%   get_rstats      : get rbin statistics (under development)
%
%---- uhdas_plots ---
%
% Programs relating to underway plotting, updating are in uhdas_plots: 
% ("help uhdas_plots" for usage)
%
%   get_uhdascfg : get a configuration structure with values to control
%                   :  paths, instrument processing parameters, 
%   update_gbin  : update the gbin files (using cfg)
%   getsome_adcp : get raw data from specified instrument (using cfg)
%   lastens      : plot last 5 minutes of data (calls os_plotens and 
%                         son_plotens)
%   os_plotens   : diagnostics plot for a few hundred pings, OS, one ping 
%                     type only
%   nb_plotens   : diagnostics plot for a few hundred pings, nb
%   son_plotens  : diagnostics plot for a few hundred pings, son
%   os_plotbbnb  : plot os bb+nb ping in a diagnostic plot
%
