% eda09_15
% read Reynolds Channel Water Quality dataset and plot it
% columns are days, precip, air_temp, water_temp, salinity, turbidity, chlorophyl

% load data
D = load('reynolds_interpolated.txt');
[N, Ncols] = size(D);
Dt=1;
Df=D;

flow = 1/30;
fhigh = 1/5;

% rename
t = Df(:,1);        % time, days
p = Df(:,2);        % precipitation, inches
at = Df(:,3);       % air temperature, deg C
wt = Df(:,4);       % water temperature, deg C
s = Df(:,5);        % salinity, practical salinity units
tb = Df(:,6);       % turbidity, (no units given)
c = Df(:,7);        % chlorophyl, micrograms per liter

% plot

itmin=1;
itmax=N;
tmin=t(itmin);
tmax=t(itmax);

figure(2);
clf;

subplot(6,1,1);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(p(itmin:itmax)), max(p(itmin:itmax))] );
plot( t, p, 'k-', 'LineWidth', 2 );
ylabel('precipitation');

subplot(6,1,2);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(at(itmin:itmax)), max(at(itmin:itmax))] );
plot( t, at, 'k-', 'LineWidth', 2 );
ylabel('T-air');

subplot(6,1,3);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(wt(itmin:itmax)), max(wt(itmin:itmax))] );
plot( t, wt, 'k-', 'LineWidth', 2 );
ylabel('T-water');

subplot(6,1,4);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(s(itmin:itmax)), max(s(itmin:itmax))] );
plot( t, s, 'k-', 'LineWidth', 2 );
xlabel('time, days');
ylabel('salinity');

subplot(6,1,5);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(tb(itmin:itmax)), max(tb(itmin:itmax))] );
plot( t, tb, 'k-', 'LineWidth', 2 );
xlabel('time, days');
ylabel('turbidity');

subplot(6,1,6);
set(gca,'LineWidth',2);
hold on;
axis( [tmin, tmax, min(c(itmin:itmax)), max(c(itmin:itmax))] );
plot( t, c, 'k-', 'LineWidth', 2 );
xlabel('time, days');
ylabel('chlorophyll');

