%% Pulled data from s0707fxt.txt (manually joined and cropped in xls cut and %% paste into ultraedit %% %% Saved s0707fxt load s0707fxt %% Check flow rate figure; hold; plot(s0707fxt(:,5)); %% Pump operating at below 1 l/m, data culled. [i,j] = find (s0707fxt(:,5) >= 1); s0707fxt = s0707fxt(i,:); %% Fixt plot(s0707fxt(:,5),'o'); %% Check position data figure; plot(s0707fxt(:,4),s0707fxt(:,3),'.') %% Bad lat long % % [i,j] = find (s0707fxt(:,3) <= 50); % % s0707fxt = s0707fxt(i,:); %% Fixt % % figure; plot(s0707fxt(:,4),s0707fxt(:,3),'o') %% Check time figure;(plot(s0707fxt(:,2))); clear i j close all save s0707fxt s0707fxt %% 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. Final file m0707.mat %% Saved two versions in CTDu_crop .xls a)has more samples, b)just bottle samples %% Manually generated CTD and SCIMS comparison m0707 %% Temperature %% Used crop_a load m0707 ts = m0707(:,7); tc = (m0707(:,13)+ m0707(:,14))./2; figure; hold; plot(ts,tc,'or'); %% Derived linear regression (R2 .9964) using cftool % Coefficients (with 95% confidence bounds): p1 = 1.015 %(1.004, 1.026) p2 = -0.4659 %(-0.6562, -0.2756) y = p1.*ts + p2; plot(ts,y,'.k'); %% Load SCIMS data load s0707fxt TS = s0707fxt(:,6); figure; hold; plot(ts,tc,'or'); %% Applying correction p1 = 1.015 %(1.004, 1.026) p2 = -0.4659 %(-0.6562, -0.2756) y = p1.*TS + p2; plot(TS,y,'.k'); %% Compare original and corrected figure;hold; plot(TS,'or') plot(y,'.k') %% SCIMS Temperature vector t0707 = y; %% Clean up clear ans TS fx sc ss tc ts ts2 x p1 p2 goodness1 fittedmodel1 close all %% Regresison for Salinity %% Used crop_a ss = m0707(:,8); sc = (m0707(:,15) + m0707(:,16))./2; %% Averages Salt0 and Salt1 figure; hold; plot(ss,sc,'ob'); %% Derived linear regression (R2 .9988) using cftool p1 = 0.9917 %(0.9855, 0.9979) p2 = 0.2903 %(0.08271, 0.498) y = p1.*ss + p2; plot(ss,sc,'.k'); %% Load SCIMS data load s0707fxt SS = s0707fxt(:,7); figure; hold; plot(ss,sc,'ob'); %% Applying correction p1 = 0.9917 %(0.9855, 0.9979) p2 = 0.2903 %(0.08271, 0.498) y = p1.*SS + p2; plot(SS,y,'.k'); %% Compare original and corrected figure;hold; plot(SS,'ob') plot(y,'.k') %% SCIMS Salinity vector s0707 = 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 %% Used crop_b fs = m0707(:,9); fc = m0707(:,25); figure; hold; plot(fs,fc,'og'); %% Derived quadratic regression using cftool p1 = 0.003868 %(0.0003248, 0.007411) p2 = 0.1605 %(0.09168, 0.2294) p3 = 0.1257 %(-0.06473, 0.3161) y = p1.*fs.^2 + p2.*fs + p3; plot(fs,y,'.k'); %% Now apply correction to all SCIMS Fluor Voltage load s0707fxt FS = s0707fxt(:,8); figure; hold; plot(fs,fc,'og'); y = p1.*FS.^2 + p2.*FS + p3; plot(FS,y,'.k'); figure;hold; plot(FS,'og') plot(y,'.k') %% SCIMS Fluorometry f0707 = y; clear ans SS fx sc ss tc ts ts2 x y p1 p2 p3 fc fs FS close all scims0707 = [s0707fxt t0707 s0707 f0707]; %% Scatter Plots load scims0707; load coast; load stacoor; % load coastline and station position %% Subset the data z = 1:10:length(scims0707); data = ones(length(z),11); for k = 1:length(z); data(k,:) = scims0707(z(k),:); end %% Temperature figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; scatter(data(:,4),data(:,3),50,data(:,9),'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 t0707path [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 t0707con %% Salinity figure; grid on; box on; ylim([29 37]); xlim([-125 -117]); hold; scatter(data(:,4),data(:,3),50,data(:,10),'filled') % plot salinity data colorbar('eastoutside'); set(gca,'clim', [32.4 34]); % set the color bar limit 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 s0707path [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(:,10),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 s0707con figure; hold; scatter(cdata(:,4),cdata(:,3),50,cdata(:,10),'filled') plot(coast(:,1),coast(:,2),'k','LineWidth', 2) colormap('winter') colorbar('eastoutside') ylim([29 37]); xlim([-125 -117]); title('0711NH - Surface Salinity (PSU)','fontsize',16,'fontname','kosMin-Bold') xlabel('longitude','fontsize',14,'fontname','kosMin-Bold') set(gca,'fontsize',12,'fontname','kosMin-Bold') ylabel('latitude','fontsize',14,'fontname','kosMin-Bold') plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) grid on box on figure; hold; cdata = sortrows(cdata,-11); % scatter(cdata(:,4),cdata(:,3),50,cdata(:,11),'filled') [i,j] = find (cdata(:,11) <= 5); scatter(cdata(i,4),cdata(i,3),50,cdata(i,11),'filled') plot(coast(:,1),coast(:,2),'k','LineWidth', 2) colormap('jet') colorbar('eastoutside') ylim([29 37]); xlim([-125 -117]); title('0711NH - Surface Fluorescence (Volts)','fontsize',16,'fontname','kosMin-Bold') xlabel('longitude','fontsize',14,'fontname','kosMin-Bold') set(gca,'fontsize',12,'fontname','kosMin-Bold') ylabel('latitude','fontsize',14,'fontname','kosMin-Bold') plot(stacoor(:,4),stacoor(:,3),'ok','MarkerSize',10) grid on box on % colormapsNc %Custom Colorbar %% clear tx tit1 special shp sc prompt nx ninc nin nfin nc n lines j index i def cns alfain S C1 B A %% Contours load scims0707 load coast load stacoor z = 1:10:length(scims0707); sub = ones(length(z),11); for k = 1:length(z); sub(k,:) = scims0707(z(k),:); end clear k z [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(:,11),x,y,'linear'); %% Change 3rd term for temp 9 sal 10 chlA 11 %gridding the temperature data to the above grid. %‘cubic’ or any other interpolation methods can be used figure; hold; scatter(sub(:,4),sub(:,3),75,sub(:,11),'filled'); colorbar('eastoutside') contourf(xi,yi,zi,'LineWidth', 2); %plotting the contour plot(coast(:,1),coast(:,2),'k','LineWidth', 2); plot(stacoor(:,4),stacoor(:,3),'k*'); ylim([29 37]); xlim([-125 -117]); %% Fluorescence [a,b] = find (scims0707(:,11) < 5); chl = (scims0707(a,:)); z = 1:10:length(chl); sub = ones(length(z),11); for k = 1:length(z); sub(k,:) = chl(z(k),:); end clear k z [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(:,11),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 set(gca,'clim', [0 5]); % setting the bar limit colorbar('eastoutside') colormapeditor % to adjust the colros %scatter(sub(:,4),sub(:,3),75,sub(:,11),'filled'); colorbar('eastoutside') plot(coast(:,1),coast(:,2),'k','LineWidth', 2); plot(stacoor(:,4),stacoor(:,3),'k*'); ylim([29 37]); xlim([-125 -117]);