McLane Moored Profiler Data Reduction and Processing Procedures

John Toole
Woods Hole Oceanographic Institution
November 2001

Introduction

As currently configured, the McLane Moored Profiler (MMP) acquires
three types of time-series data on each vertical profile: Engineering
(time, motor current, battery voltage, pressure), CTD (conductivity,
temperature, pressure), and ACM (acoustic current meter - four channels
of raw velocity data, three channels of compass readings and 2 axes of
tilt).  For each vertical profile, one binary file of each type is
written to the flash memory card.  These Profiler data files are
processed (together with calibration information that characterize the
raw sensor data) into uniformly binned pressure series of ocean
temperature, salinity, and velocity using a series of Matlab scripts
developed at the Woods Hole Oceanographic Insitution for use on
Unix-based computers.

The binary data on the MMP's flash card are accessed on a PC via the
MRL software routine NAME.  Choose the option for producing "machine
readable" output; the product will be a set of three ascii data files
(Cnnnnnn.txt Annnnnnn.txt, Ennnnnnn.txt) for each profile.  


Quick Looks

For looking quickly at the ascii data files within the Matlab
environment, use the routines:

MMP_read_eng.m
	returns the following variables as Matlab vectors:
		epres, xxx ecurr, eVolt, escans
MMP_read_ctd.m
	returns the following variables as Matlab vectors:
		cpres, ctemp, ccond, cscans
MMP_read_acm.m
	returns the following variables as Matlab vectors:
		Vab Vcd Vef Vgh aHx aHy aHz aTx aTy ascans

Use the Matlab plot command to display any of these variables.


Merging profile files

To facilitate processing and archiving the raw MMP data, we merge the
Engineering, CTD and ACM data from each profile into one, Matlab-format
data file (e.g. one file per profile).  



Pressure gridding

The Matlab routine MMP_pgrid.m and its assorted subroutines contained
in this directory are designed to reduce time series of raw
temperature, conductivity and pressure data from the FSI EMCTD and
velocity path data and compass measurements from the FSI acoustic
current meter and create pressure-bin-averaged data in scientific
units.  We begin by assuming that the previous step of loading the
ascii engineering, CTD and ACM data files into matlab format (one file
per profile) has been completed.  (These must be called rawnnnn.dat in
an arbitrary, user-specified directory.) Input to the pressure griding
routine include paths to the input and output data directories, various
sensor calibration files, and user specified pressure bounds and grid
increment on which the data will be averaged.  To align the CTD and ACM
data streams, the program automatically locates the starting and ending
transients at the top and bottom of the profile interval.  The user
also specifies the profiles to be processed on each run of the
program.  Output files are called grdnnnn.mat, along with a
documentation file (one per run of MMP_pgrid) called mmp_pgrid_N_M.doc
where M is the first profile processed in the run and M is the last.


Input

For both the CTD and the ACM, you are asked to input some edit
parameters, specifically the minimum and maximum allowable values for
each parameter.  Data outside these intervals will be assumed to be bad
and interpolated over.  You are also are required to have a matlab
format file holding sensor calibration information.

For the CTD, the calibration information must include the following
vectors:  p_coefs, t_coefs and c_coefs, where each are the coefficients
of polynomials that convert raw sensor values to calibrated values with
the matlab utility polyval:
    cpres=polyval(p_coefs,cpres);
    ctemp=polyval(t_coefs,cpres);
    ccond=polyval(c_coefs,cpres);

In addition, the file must hold the variable "tlag" which is the lag in
scans that the thermometer lags the conductivity.  The CTD data are lag
corrected by recursively filtering the C and P data to match the
response characteristics of the T data.
    [ccond]=MMP_recur_filt(ccon,tlag);
    [cpres]=MMP_recur_filt(cpres,tlag);

For the ACM, the calibration file needs to hold the variables:
    Hx_bias, Hx_range, Hy_bias, Hy_range, dirsign, compass_bias,
    Vab_bias, Vcd_bias, Vef_bias, Vgh_bias, velocity_scale
The magnetometer data are scaled to the unit circle as follows:
   [(aHx-Hx_bias)/Hx_range]^2 + [(aHy-Hy_bias)/Hy_range]^2 = 1
Insitu data may be used to work out the magnetometer bias and range terms.

The true compass direction that the ACM sensor sting points to is 
derived as follows:
       	mvpdir=dir_sign*atan2(aHy,aHx)+compass_bias+mag_dev
where mag_dev is the earth's magnetic deviation (user enters this number
when running MMP_pgrid.  Laboratory spin test data are used to derive 
dirsign and compass_bias.