function [WL fieldname]=readTides(varargin)
OPT = struct(...
    'tidespath', fullfile(cd,'..','InputData','Buoy','Tides'),...
    'location',4,...
    'visualize',0);

OPT = setproperty(OPT, varargin{:});

matfiles = dir(fullfile(OPT.tidespath, '*.mat'));

for ifile = 1:length(matfiles)
    fnames{ifile} = matfiles(ifile).name;
end
station_names = strrep(fnames, '.mat', '');
%% 
for i = 1:length(fnames)
    temp = load(fullfile(fullfile(OPT.tidespath,fnames{i})));
    fieldname{i,1} = station_names(i);
    WL.(fieldname{i,1}{1,1}).time = temp.tide(:,1);
    WL.(fieldname{i,1}{1,1}).predictions= temp.tide(:,2);
    WL.(fieldname{i,1}{1,1}).measurements= temp.tide(:,3);
end

if OPT.visualize==1
    for i = OPT.location
        figure('Name',(fieldname{i,1}{1,1}));
    %     plot(WL.(fieldname{i,1}{1,1}).time,WL.(fieldname{i,1}{1,1}).predictions);hold on;
        plot(WL.(fieldname{i,1}{1,1}).time,WL.(fieldname{i,1}{1,1}).measurements, 'r');
        title((fieldname{i,1}{1,1}));
        datetick('x');
    end
end