
% First compute depth in time-base of CTD data

ctd_depth = ctd_depth_prep(dataNav(:,1), dataNav(:,mDepth), ctdlog(:,1));

% Now compute pressure in dB from depth

dBar = sw_pres(ctd_depth, 36.8);  % Use 36.8 as latitude....

% Now compute temperature and conductivity using the correct coefficients

[temp,cond,mask] = ctd_freq_conv(dBar, ctdlog(:,cond_frequency), ctdlog(:,temp_frequency), 'night' );

% Compute salinity from conductivity, temperature, and pressure

salt = sw_salt(10*cond/sw_c3515,temp,dBar);

% Compute density from salinity, temperature, and pressure.

dens = sw_dens(salt, temp, dBar);
