% write_CUGN_to_gliderviz_txt.m



clear
close all

% .mat files produced by Derive_empirical_parameters.m
ddir = 'C:\Users\bwerb\Documents\CUGNROMS\CUGN\data';
% GliderVIZ .txt files are written here
outdir = 'C:\Users\bwerb\Documents\CUGNROMS\CUGN\for_distribution';
if ~exist(outdir,'dir')
    mkdir(outdir);
end

fnames = {'CUGN_along_withEmp.mat'
    'CUGN_line_56_withEmp.mat'
    'CUGN_line_66_withEmp.mat'
    'CUGN_line_80_withEmp.mat'
    'CUGN_line_90_withEmp.mat'};

% for info in the header
lines = {'Along', 'Line 56', 'Line 66', 'Line 80', 'Line90'};


% fill in some parameters as NaNs so you can write into gliderviz easily

for i = 1:length(fnames)

    % load transect
    load(fullfile(ddir,fnames{i}),'s');

    % write GliderVIZ text file
    disp(['Writing ',lines{i},' text file...']);
    convert_s2gliderviztxt_CUGN_ArgoFlags(s, lines{i}, outdir);

    clear s

end






















