This README file describes the file contents and processing steps for
each file of level1 mooring CTD data for the Long Bay Wintertime
(2012) Project.

---------
History of upload
---------
June 20, 2012 initial format and upload (SH)
July 11, 2012 QC'd data using range tests and sensor health (SH)
Dec 15, 2014 Final QC manually removed suspect data for known sensor failure (SH)
Dec 15, 2014 Final caluclations for salin, density using GSW Toolbox

---------
1. Files
---------

/data/long_bay/level1/

lb1
|-- lb1_ctd.mat
lb2
|-- lb2_ctd.mat
lb3
|-- lb3_ctd.mat

-----------------
2. File Contents
-----------------

Three structures contain data pertaining to the deployment and sensor configuration

          platform: [1x1 struct] -- deployment location and depth info about bottom frame
            config: [1x1 struct] -- sensor configuration info and parameters
                qc: [1x1 struct] -- added structure that contains tolerances and flagged 
		    	 	    data for various qc tests

For example LB1 platform structure contains the following
>> data.platform

ans = 

                        id: 'lb1'
                       loc: 'Long Bay, NC, Shelf Bottom Frame'
          mean_water_depth: 30
    mean_water_depth_units: 'm'
                       lat: 33.1695
                       lon: -78.3334
                      mvar: -8.7000
                  start_dn: 7.3489e+005
                   last_dn: 7.3496e+005

CTD configuration info extracted from raw files are stored in config structure
>> data.config

ans = 

            serial_number: '1602'
          sample_interval: 300
    sample_interval_units: 'seconds'
                    units: {7x2 cell}

The cell array in config structure called config.units stores the
units of each variable

>> config.units

ans = 

    'mtime'    'days since 0000-01-01T00:00'
    'wtemp'    'deg C'                      
    'press'    'decibars'                   
    'cond'     'S m-1'                      
    'salin'    'psu'                        
    'depth'    'm'                          
    'dens'     'kg m-3'                     


Each file contains measured and derived parameters-one variable for
each parameter.  The variable index corresponds to same index of mtime
(or matlab time) for time of each sample.

       wtemp: [21574x1 double]
        cond: [21574x1 double]
       press: [21574x1 double]
       mtime: [21574x1 double]
       depth: [21574x1 double]
       salin: [21574x1 double]
        dens: [21574x1 double]


--------------------
3. Processing Steps
--------------------

The following scripts are used to process level0 raw data to level1.  

More detailed information regarding the processing steps can be
obtained from the MATLAB scripts and the summary below. 

proc_ctd_raw.m -- reads data from SeaBird SMP37 asc format downloaded
from each CTD and stored in level0

Salinity (salin), water density (dens) and depth from pressure where
calculated using the Gibbs Seawater (GSW) function MATLAB toolbox (IOC, UNESCO 2010).

proc_ctd_qc.m -- quality control steps applied to ctd data to
eliminate data not associated or out tolerances specified.

1. remove data when bottom frame not at deployment depth (trim beginning and end values)
2. evaluate sensors (cond, depth, temperature within tolerances)

For example LB1 CTD quality control tolerances are provided in the qc structure:
>> data.qc

ans = 

     rangeTest_cond_tol: [3 6]
    rangeTest_press_tol: [0 40]
    rangeTest_wtemp_tol: [-5 35]
