Quick Look at raw data
For looking quickly at any
of these ascii data files within the Matlab environment, use the routines
MMP_read_eng.m, MMP_read_ctd.m, MMP_read_ACM.m. These are not included
in the GUI tool, so must be run from the command line.
MMP_read_eng.m returns
the following variables as Matlab vectors:
esnum: index of the engineering scans
epres: engineering pressure in decibars
ecurr: motor current in milli-Amps
evolt: battery Voltage
edpdt: profile speed dbars/s from the engineering data
engtime: time of each engineering scan coded with matlab function datenum.m
MMP_read_ctd.m returns
the following variables as Matlab vectors:
csnum: index of the CTD scans
cpres: pressure in decibars
ctemp: temperature in nominal degrees C
ccond: conductivity in nominal mmho
MMP_read_acm.m
returns the following variables as Matlab vectors:
asnum: index of the ACM scans
Vab Vcd Vef Vgh: raw path velocities in nominal cm/s
aHx aHy aHz: horizontal (x,y) and vertical (z) normalized compass readings
aTx aTy: tilt in fore-aft and athwartships degrees
Required input includes the directory names for the source data, the name of the directory where you want the combined output files to go, and the range of profiles you wish to process.
The output data files are called raw####.mat. Each file contains the following variables:
psdate: profile start date
pedate: profile end date
pstart: profile start time
pstop: profile end time
esnum: index of the engineering scans
epres: engineering pressure in decibars
ecurr: motor current in milli-Amps
evolt: battery Voltage
edpdt: profile speed dbars/s from the engineering data
engtime: time of each engineering scan coded with matlab function datenum.m
csnum: index of the CTD scans
ccond: conductivity in nominal mmho
ctemp: temperature in nominal degrees C
cpres: pressure in decibars
asnum: index of the ACM scans
Vab: raw path velocities in nominal cm/s
Vcd: raw path velocities in nominal cm/s
Vef: raw path velocities in nominal cm/s
Vgh: raw path velocities in nominal cm/s
aTx: tilt in fore-aft and athwartships degrees
aTy: tilt in fore-aft and athwartships degrees
aHx: horizontal (x) normalized compass readings
aHy: horizontal (y) normalized compass readings
aHz: vertical normalized compass readings
The Matlab function MMP_raw_summary.m gives the user a way to look at data from an entire deployment and quantify such things as minimum and maximum pressure sampled on each profile and the profile-averaged speed, motor current and battery voltage. The routine works with the combined matlab-format raw data files created by MMP_asc2mat (raw####.mat). User is asked to input the name of the directory where these data files are located, and the range of profiles to process. The user must also enter a minimum and maximum pressure within which various vertically-averaged parameters will be evaluated.
Hint:
picking these limits
somewhat smaller than the actual range sampled by the Profiler will exclude
the start up and ending transients from the averages.
The following vectors are written to a user-specified
summary output file:
files:
vector of profile numbers
starttime:
profile start time encoded with datenum.m
endtime:
profile ending time encoded with datenum.m
neng:
number of engineering scans in the profile
nctd:
number of CTD scans in each profile
nacm:
number of ACM scans in each profile
cpmin:
minimum Pressure recorded by the CTD on each profile
cpmax:
maximum Pressure recorded by the CTD on each profile
epmin:
minimum engineering pressure recorded on each profile
epmax:
maximum engineering pressure recorded on each profile
espeed:
average travel speed for each profile dbars/second
avevolt:
average battery voltage during each profile
avecur:
average motor current during each profile
A shell script, MMP_pgrid_script.sh was created to simplify entering the inputs for MMP_pgrid_mfile.m. These modifications to John's pgrid code were made by Maggie Cook (also of WHOI) to simplify the processingbefore the GUI tool was developed, and to include more information in the mmp_pgrid_M_N.doc file. The script will not run on PC's but it can be used to illustrate the steps it executes. The computations are the same as performed by MMP_pgrid, as described below.
Conceptually, the data from the CTD and ACM are checked to insure that all variables are with sensible range (specified by the user) and pass a first difference check. Bad raw data are interpolated. Time is logged in the engineering file along with a pressure reading. These data are used to interpolate a time estimate for each CTD scan. Apart from the logged times when the MMP starts and stops the external sensors, there are no cross-referenced time marks between the CTD and ACM apart from a manufacturer-stated common sample rate. 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 and assumes constant (but not necessarily the same) sample rate for each sensor. This is sufficient to define the time value for each ACM scan, allowing common binning of all data against pressure. Once the alignment is set and the raw data have been edited and calibrated, the bin-averaging against pressure is carried out and the resultant data are written out to the user specified directory as grd####.mat.
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);
The magnetometer data are scaled to the unit circle as follows:
[(aHx-Hx_bias)/Hx_range]^2
+ [(aHy-Hy_bias)/Hy_range]^2 = 1
In situ data are used to work out the magnetometer bias and range terms
that will scale the compass data to the unit circle. The true compass
direction towards which the ACM sensor sting points is derived as
follows:
mvpdir=dir_sign*atan2(aHy,aHx)+compass_bias+mag_dev
where mag_dev is the earth's magnetic deviation . Laboratory spin test data are used to derive dirsign and compass_bias.
You may create the calibration files manually or use the scripts create_ctd_calfile.m and create_acm_calfile.m to guide you through the data entry.
startdaytime:
start day and time of the profile (encoded with datenum.m)
stopdaytime:
stop day and time of the profile (encoded with datenum.m)
pgrid:
the center values of the pressure grid used in the bin-average
ctimave:
day and time of values averaged in each pgrid bin (datenum.m)
pave:
average of the pressure values in each pgrid bin dbars
tave:
average of the temperature values in each pgrid bin degC
s_ave:
salinity computed pave, tave and cave pss
thetave:
potential temperature computed from pave, tave, and s_ave degC
sigthave:
potential density computed from pave, tave and s_ave kg/m^3
cave:
average scaled conductivity in each pgrid bin mmho
uave:
average east velocity in each pgrid bin cm/s
vave:
average north velocity in each pgrid bin cm/s
wave:
average relative vertical velocity in each pgrid bin cm/s
dpdtave:
average time rate of change of pressure dbars/s
cscan1
cscan2: indices of the CTD data averaged in each pgrid bin
ascan1
ascan2: indices of the ACM data averaged in each pgrid bin