%plot_tides.m
% Plot water level data from NOAA tide gauge stations
% 26 March 2019  A. Pfeiffer-Herbert

%% LOAD DATA BEFORE RUNNING SCRIPT
% On the Home tab, click on Import Data
% Navigate to NOAA Tides_25Feb2019.xlsx file and open
% Select desired worksheet on the bottom of the Import window
% Make sure that the columns of data are selected, but not the text headers
% Change Output Type to Column vectors (upper bar)
% Click Import Selection 

%% Change station name here
Stn = 'Atlantic City';

%% Remaining code will automatically produce plots of the tides

figure('color','w')
subplot(2,1,1)
plot(DateTime_UTC,Predicted_m,'b')
hold on
plot(DateTime_UTC,Actual_m,'r')
xlabel('Date (UTC)')
ylabel('Water level (m)')
legend('Predicted tide','Observed water level','Location','northwest')
title(strcat('Station: ',Stn))
set(gca,'ylim',[-2,2])
subplot(2,1,2)
plot(DateTime_UTC,Actual_m-Predicted_m,'k')
xlabel('Date (UTC)')
ylabel('Observed - Predicted water level (m)')