%% imported data from s0810raw.txt %% %% Saved s0810raw load s0810raw %% Flow rates figure; plot(s0810raw(:,5)); %% Are all good %% Check position data figure; plot(s0810raw(:,4),s0810raw(:,3),'.') %% Looks good %% Check time figure;(plot(s0810fxt(:,2))); clear i j close all %% Saved as s0810fxt %% Import CTD and Bottle salts %% Joined all CTDd files and culled to SCIMS variables %% Find the surface data - because the 'shallowest' can be 1, 2 or 3m we %% have to cull them all then remove the duplicates. %% Did it manually. %% Manually generated CTD and SCIMS comparison from s0810ALLcrop3.xls, %% cut and paste into ultraedit saved as m0810.txt %% saved as m0810.mat %% Temperature load m0810 ts = m0810(:,9); tc = (m0810(:,13)+ m0810(:,14))./2; figure; hold; plot(ts,tc,'or'); %% Derived linear regression (R2 0.9824) using cftool % Coefficients (with 95% confidence bounds): p1 = 1.002; %(0.9654, 1.038) p2 = -0.0714; %(-0.593, 0.4502) y = p1.*ts + p2; plot(ts,y,'.k'); %% Load SCIMS data load s0810fxt TS = s0810fxt(:,5); figure; hold; plot(ts,tc,'or'); y = p1.*TS + p2; plot(TS,y,'.k'); %% Compare original and corrected figure;hold; plot(TS,'or') plot(y,'.k') %% SCIMS Temperature vector t0810 = y; %% Clean up clear ans TS fx sc ss tc ts ts2 x p1 p2 goodness1 fittedmodel1 close all %% Regresison for Salinity ss = m0810(:,10); sc = (m0810(:,15) + m0810(:,16))./2; %% Averages Salt0 and Salt1 figure; hold; plot(ss,sc,'ob'); %% Derived linear regression (R2 .9942) using cftool p1 = 0.9927; %(0.9721, 1.013) p2 = 0.2601; %(-0.429, 0.9492) y = p1.*ss + p2; plot(ss,sc,'.k'); %% Load SCIMS data load s0810fxt SS = s0810fxt(:,6); figure; hold; plot(ss,sc,'ob'); y = p1.*SS + p2; plot(SS,y,'.k'); %% Compare original and corrected figure;hold; plot(SS,'ob') plot(y,'.k') %% SCIMS Salinity vector s0810 = y; clear ans SS fx sc ss tc ts ts2 x p1 p2 goodness1 fittedmodel1 close all %% Regression for Fluorometry vs ChlA %% ChlA data from CTDu file fs = m0810(:,11); fc = m0810(:,26); figure; hold; plot(fs,fc,'og'); %% Derived quadratic regression (R2 0.4203)using cftool p1 = 3.078; %(2.072, 4.084) p2 = -0.1511; %(-0.4867, 0.1844) y = p1.*fs + p2; plot(fs,y,'.k'); %% Now apply correction to all SCIMS Fluor Voltage load s0810fxt FS = s0810fxt(:,7); figure; hold; plot(fs,fc,'og'); y = p1.*FS + p2; plot(FS,y,'.k'); figure;hold; plot(FS,'og') plot(y,'.k') %% SCIMS Fluorometry f0810 = y; clear ans SS fx sc ss tc ts ts2 x y p1 p2 p3 fc fs FS close all scims0810 = [s0810fxt t0810 s0810 f0810]; %% Scatter Plots load scims0810; load coast; load stacoor; % load coastline and station position %% Subset the data z = 1:10:length(scims0810); data = ones(length(z),10); for k = 1:length(z); data(k,:) = scims0810(z(k),:); end %% Temperature figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; scatter(data(:,4),data(:,3),50,data(:,8),'filled') % plot temperature data plot(coast(:,1),coast(:,2),'k','LineWidth', 2) % plot coastline plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) % plot station position % set(gca,'clim', [10 26]); % set the color bar limit colorbar('eastoutside'); % position the bar colormapeditor; % edit the bar (1-blue(5,-4) : 32-white : 64-red(1,-2) % print -depsc -r300 t0810path figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; [x y] = meshgrid (min(data(:,4)):.1:max(data(:,4)), min(data(:,3)):.1:max(data(:,3)) ); %minimum value:increment:maximum value of x and y axis grid [xi,yi,zi] = griddata(data(:,4),data(:,3),data(:,8),x,y,'linear'); % grid the data contourf(xi,yi,zi,'LineWidth', 2); % plotting the contour plot(coast(:,1),coast(:,2),'k','LineWidth', 2) % plot coastline plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) % plot station position grid on; box on; % print -depsc -r300 t0810con %% Salinity figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; scatter(data(:,4),data(:,3),50,data(:,9),'filled') % plot salinity data % caxis([32.4 34]); % set the color bar limit colorbar('eastoutside'); % colorbar('YTickLabel',{'32.4','32.8','33.2','33.6','34.0'}); % position the bar plot(coast(:,1),coast(:,2),'k','LineWidth', 2) % plot coastline plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) % plot station position % set(gca,'clim', [32.4 34]); % set the color bar limit colormapeditor; % edit the bar (1-blue(5,-4) : 32-white : 64-purple(8,-4) % print -depsc -r300 s0810path figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; [x y] = meshgrid (min(data(:,4)):.1:max(data(:,4)), min(data(:,3)):.1:max(data(:,3)) ); %minimum value:increment:maximum value of x and y axis grid [xi,yi,zi] = griddata(data(:,4),data(:,3),data(:,9),x,y,'linear'); % grid the data contourf(xi,yi,zi,'LineWidth', 2); % plotting the contour plot(coast(:,1),coast(:,2),'k','LineWidth', 2) % plot coastline plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) % plot station position grid on; box on; % print -depsc -r300 s0810con %% Fluorescence %% No substantial variablility [a,b] = find (scims0810(:,10)); chl = (scims0810(a,:)); z = 1:10:length(chl); sub = ones(length(z),10); for k = 1:length(z); sub(k,:) = chl(z(k),:); end figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; scatter(sub(:,4),sub(:,3),75,sub(:,10),'filled'); colorbar('eastoutside') colormapeditor % to adjust the colors all red %print -depsc -r300 c0810path [x y] = meshgrid (min(sub(:,4)):.1:max(sub(:,4)), min(sub(:,3)):.1:max(sub(:,3)) ); %minimum value:increment:maximum value of x and y axis grid [xi,yi,zi] = griddata(sub(:,4),sub(:,3),sub(:,10),x,y,'linear'); %gridding the temperature data to the above grid. %‘cubic’ or any other interpolation methods can be used figure; hold; contourf(xi,yi,zi,'LineWidth', 2); %plotting the contour colormapeditor % to adjust the colros plot(coast(:,1),coast(:,2),'k','LineWidth', 2); plot(stacoor(:,4),stacoor(:,3),'k*'); ylim([29 37]); xlim([-125 -117]); %print -depsc -r300 c0810con